Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
66 changes: 66 additions & 0 deletions .github/workflows/upgrade-aws.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
on:
push:
branches:
- master
name: ECR
env:
DOCKER_BUILDKIT: 1
COMPOSE_DOCKER_CLI_BUILD: 1
jobs:
prepare-ecr:
name: Prepare ECR
runs-on: ubuntu-latest
timeout-minutes: 1
outputs:
role: ${{ steps.prepare.outputs.role }}
branch: ${{ steps.prepare.outputs.branch }}
steps:
- name: Prepare
id: prepare
run: |
case ${{github.ref}} in
refs/heads/master)
role=arn:aws:iam::983851922138:role/GHA,github-actions-php-cs-fixer
branch=master
;;
*)
echo "Unknown ref: ${{github.ref}}"
exit 1
;;
esac
echo branch: $branch
echo role: $role
echo "branch=$branch" >> $GITHUB_OUTPUT
echo "role=$role" >> $GITHUB_OUTPUT
ecr:
name: ECR
runs-on: ubuntu-latest
needs: [prepare-ecr]
timeout-minutes: 15
permissions:
id-token: write
contents: read
steps:
- uses: actions/checkout@v3
- name: Setup Docker Compose
run: |
if [ ! -f docker-compose.${{needs.prepare-ecr.outputs.branch}}.yml ]; then
echo 'version: "3.8"' > docker-compose.${{needs.prepare-ecr.outputs.branch}}.yml
fi
- name: Setup Docker Buildx
uses: docker/setup-buildx-action@v1
- uses: aws-actions/configure-aws-credentials@v1
name: Configure AWS Credentials (eu-central-1)
with:
role-to-assume: ${{needs.prepare-ecr.outputs.role}}
aws-region: us-east-1
role-duration-seconds: 900
- name: Login to Amazon ECR
id: login-ecr
uses: aws-actions/amazon-ecr-login@v1
with:
registry-type: 'public'
- name: Build
run: docker compose build --build-arg BUILDKIT_INLINE_CACHE=1
- name: Push
run: docker compose push
11 changes: 6 additions & 5 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
FROM --platform=linux/amd64 php:8.1-alpine
FROM --platform=linux/amd64 php:8.1.34-cli-alpine

LABEL "com.github.actions.name"="PHP-CS-Fixer"
LABEL "com.github.actions.description"="check php files"
LABEL "com.github.actions.icon"="check"
LABEL "com.github.actions.color"="blue"

RUN wget https://github.com/FriendsOfPHP/PHP-CS-Fixer/releases/download/v3.13.0/php-cs-fixer.phar -O php-cs-fixer \
&& chmod a+x php-cs-fixer \
&& mv php-cs-fixer /usr/local/bin/php-cs-fixer
# Pin PHP 8.1.34 to match mobsuccess (same digest as php:8.1-alpine today).
RUN wget -O /usr/local/bin/php-cs-fixer \
https://github.com/FriendsOfPHP/PHP-CS-Fixer/releases/download/v3.13.0/php-cs-fixer.phar \
&& chmod a+x /usr/local/bin/php-cs-fixer

ADD entrypoint.sh /entrypoint.sh
COPY entrypoint.sh /entrypoint.sh
ENTRYPOINT ["/entrypoint.sh"]
2 changes: 1 addition & 1 deletion action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,4 @@ name: 'OSKAR-PHP-CS-Fixer'

runs:
using: 'docker'
image: 'docker://oskarstark/php-cs-fixer-ga:2.18.2'
image: 'docker://public.ecr.aws/u9q7y3l4/github-actions-php-cs-fixer:v3.13.0'
Loading