From 759c85e4bb2cdeaafd8aed9050e8dc69c4dcde76 Mon Sep 17 00:00:00 2001 From: Gertjan Krol Date: Sat, 2 Sep 2023 17:04:53 +0200 Subject: [PATCH] Updated workflows --- .forgejo/workflows/release.yaml | 30 ++++++++++++++++++++++-------- .forgejo/workflows/test-build.yaml | 23 +++++++++++++++-------- 2 files changed, 37 insertions(+), 16 deletions(-) diff --git a/.forgejo/workflows/release.yaml b/.forgejo/workflows/release.yaml index 8ededc6..b379f3c 100644 --- a/.forgejo/workflows/release.yaml +++ b/.forgejo/workflows/release.yaml @@ -8,15 +8,29 @@ jobs: build_push: runs-on: ubuntu-latest container: git.gertjankrol.nl/docker/toolkit:latest - env: - REGISTRY: git.gertjankrol.nl - IMAGE_NAMESPACE: docker/php steps: - name: Check out repository uses: actions/checkout@v3 - name: Docker login - run: docker login -u ${{ secrets.DOCKER_USERNAME }} -p ${{ secrets.DOCKER_PASSWORD }} https://${REGISTRY} - - name: Build and push containers - run: | - docker build . -t ${REGISTRY}/${IMAGE_NAMESPACE}:${{ github.ref_name }} --push - docker build . -f Dockerfile-fpm -t ${REGISTRY}/${IMAGE_NAMESPACE}:${{ github.ref_name }}-fpm --push + uses: actions/docker-login@v2 + with: + registry: ${{secrets.DOCKER_REGISTRY}} + username: ${{secrets.DOCKER_USERNAME}} + password: ${{secrets.DOCKER_PASSWORD}} + - name: Build and push PHP image + uses: actions/docker-build-push@v4 + with: + tags: | + ${{secrets.DOCKER_REGISTRY}}/${{github.repository}}:${{github.ref_name}} + ${{secrets.DOCKER_REGISTRY}}/${{github.repository}}:latest + push: true + - name: Build and push PHP-FPM image + uses: actions/docker-build-push@v4 + with: + tags: | + ${{secrets.DOCKER_REGISTRY}}/${{github.repository}}-fpm:${{github.ref_name}} + ${{secrets.DOCKER_REGISTRY}}/${{github.repository}}-fpm:latest + file: Dockerfile-fpm + push: true +# env: +# ACTIONS_RUNTIME_TOKEN: '' #https://gitea.com/gitea/act_runner/issues/119#issuecomment-738294 diff --git a/.forgejo/workflows/test-build.yaml b/.forgejo/workflows/test-build.yaml index 90b0c91..0f2dae7 100644 --- a/.forgejo/workflows/test-build.yaml +++ b/.forgejo/workflows/test-build.yaml @@ -11,11 +11,18 @@ jobs: steps: - name: Check out repository uses: actions/checkout@v3 - - name: Build containers - run: | - docker build . -t php-test:${{ github.ref_name }} - docker build . -f Dockerfile-fpm -t php-test:${{ github.ref_name }}-fpm - - name: Default image details - run: docker image inspect php-test:${{ github.ref_name }} - - name: FPM image details - run: docker image inspect php-test:${{ github.ref_name }}-fpm + - name: Build PHP image + uses: actions/docker-build-push@v4 + with: + tags: php-test:${{github.ref_name}} + push: false + - name: PHP image details + run: docker image inspect php-test:${{github.ref_name}} + - name: Build PHP-FPM image + uses: actions/docker-build-push@v4 + with: + tags: php-test-fpm:${{github.ref_name}} + file: Dockerfile-fpm + push: false + - name: PHP-FPM image details + run: docker image inspect php-test-fpm:${{github.ref_name}}