From 0340f4da01a458459a66bc0e753fbbaa43dbb912 Mon Sep 17 00:00:00 2001 From: Gertjan Krol Date: Sat, 2 Sep 2023 17:17:42 +0200 Subject: [PATCH] Updated workflows --- .forgejo/workflows/release.yaml | 19 +++++++++++++------ .forgejo/workflows/test-build.yaml | 13 ++++++++++--- 2 files changed, 23 insertions(+), 9 deletions(-) diff --git a/.forgejo/workflows/release.yaml b/.forgejo/workflows/release.yaml index b377eb6..b14da57 100644 --- a/.forgejo/workflows/release.yaml +++ b/.forgejo/workflows/release.yaml @@ -8,13 +8,20 @@ jobs: build_push: runs-on: ubuntu-latest container: git.gertjankrol.nl/docker/toolkit:latest - env: - REGISTRY: git.gertjankrol.nl - IMAGE_NAMESPACE: docker/php-toolkit 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 . --build-arg VERSION=${{ github.ref_name }} -t ${REGISTRY}/${IMAGE_NAMESPACE}:${{ github.ref_name }} -t ${REGISTRY}/${IMAGE_NAMESPACE}:latest --push + uses: actions/docker-login@v2 + with: + registry: ${{secrets.DOCKER_REGISTRY}} + username: ${{secrets.DOCKER_USERNAME}} + password: ${{secrets.DOCKER_PASSWORD}} + - name: Build and push image + with: + build-args: | + VERSION=${{github.ref_name}} + tags: | + ${{secrets.DOCKER_REGISTRY}}/${{github.repository}}:${{github.ref_name}} + ${{secrets.DOCKER_REGISTRY}}/${{github.repository}}:latest + push: true diff --git a/.forgejo/workflows/test-build.yaml b/.forgejo/workflows/test-build.yaml index 46b75c9..176aa93 100644 --- a/.forgejo/workflows/test-build.yaml +++ b/.forgejo/workflows/test-build.yaml @@ -11,7 +11,14 @@ jobs: steps: - name: Check out repository uses: actions/checkout@v3 - - name: Build container (8.2) - run: docker build . --build-arg VERSION=8.2 -t php-toolkit-test:${{ github.ref_name }} + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v2 + - name: Build image (8.2) + uses: actions/docker-build-push@v4 + with: + build-args: | + VERSION=8.2 + tags: php-toolkit-test:${{github.ref_name}} + push: false - name: Image details - run: docker image inspect php-toolkit-test:${{ github.ref_name }} + run: docker image inspect php-toolkit-test:${{github.ref_name}}