From 2602e96993d80ec7c7ec7d2274fa75f68bdee720 Mon Sep 17 00:00:00 2001 From: vrenaville Date: Wed, 3 Jul 2024 11:10:08 +0200 Subject: [PATCH] feat: update pipeline automerge --- .github/workflows/ci.yaml | 39 --------------------------- .github/workflows/release-please.yaml | 28 +++++++++++++++++++ 2 files changed, 28 insertions(+), 39 deletions(-) delete mode 100644 .github/workflows/ci.yaml diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml deleted file mode 100644 index fa36b67..0000000 --- a/.github/workflows/ci.yaml +++ /dev/null @@ -1,39 +0,0 @@ -name: Test, build and push to github packages -on: - pull_request: - branches: - - 'master' - push: - branches: - - '*' - tags: - - '*' - -jobs: - build-images: - if: ${{ github.event_name == 'push' }} - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v2 - - name: Set ENV for branch master/main - if: ${{ github.ref == 'refs/heads/master' }} - run: echo "RELEASE_VERSION=latest" >> $GITHUB_ENV - - name: Set ENV for tags - if: ${{ startsWith(github.ref, 'refs/tags/') }} - run: echo "RELEASE_VERSION=${GITHUB_REF#refs/*/}" >> $GITHUB_ENV - - name: Set ENV for specific branch - if: ${{ startsWith(github.ref, 'refs/heads/') && !endsWith(github.ref, '/master') }} - run: echo "RELEASE_VERSION=${GITHUB_REF#refs/*/}-${GITHUB_SHA}" >> $GITHUB_ENV - - name: Login to GHCR - uses: docker/login-action@v1 - with: - registry: ghcr.io - username: ${{ github.repository_owner }} - password: ${{ secrets.GITHUB_TOKEN }} - - name: Build Image Odyssey - uses: docker/build-push-action@v2 - with: - context: . - platforms: linux/amd64 - push: true - tags: ghcr.io/${{ github.repository }}:${{ env.RELEASE_VERSION }} diff --git a/.github/workflows/release-please.yaml b/.github/workflows/release-please.yaml index 4e8e9ea..8c0b21c 100644 --- a/.github/workflows/release-please.yaml +++ b/.github/workflows/release-please.yaml @@ -14,3 +14,31 @@ jobs: - uses: "googleapis/release-please-action@v4" with: release-type: "simple" + build-images: + if: ${{ github.event_name == 'push' }} + runs-on: ubuntu-latest + needs: release-please + steps: + - uses: actions/checkout@v2 + - name: Set ENV for branch master/main + if: ${{ github.ref == 'refs/heads/master' }} + run: echo "RELEASE_VERSION=latest" >> $GITHUB_ENV + - name: Set ENV for tags + if: ${{ startsWith(github.ref, 'refs/tags/') }} + run: echo "RELEASE_VERSION=${GITHUB_REF#refs/*/}" >> $GITHUB_ENV + - name: Set ENV for specific branch + if: ${{ startsWith(github.ref, 'refs/heads/') && !endsWith(github.ref, '/master') }} + run: echo "RELEASE_VERSION=${GITHUB_REF#refs/*/}-${GITHUB_SHA}" >> $GITHUB_ENV + - name: Login to GHCR + uses: docker/login-action@v1 + with: + registry: ghcr.io + username: ${{ github.repository_owner }} + password: ${{ secrets.GITHUB_TOKEN }} + - name: Build Image Odyssey + uses: docker/build-push-action@v2 + with: + context: . + platforms: linux/amd64 + push: true + tags: ghcr.io/${{ github.repository }}:${{ env.RELEASE_VERSION }}