Skip to content

Commit

Permalink
feat: add matrix strategy to docker workflow (#69)
Browse files Browse the repository at this point in the history
Build images for each environment on pushes to main
Build tagged release on tag pushes
  • Loading branch information
jgryffindor authored Nov 26, 2024
1 parent 8dc82b2 commit b3904e3
Showing 1 changed file with 20 additions and 3 deletions.
23 changes: 20 additions & 3 deletions .github/workflows/docker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,16 @@ on:
push:
branches:
- main
tags:
- '*'

jobs:
build-and-push:
runs-on: ubuntu-latest
environment: 'Production - Testnet'

strategy:
matrix:
environment: [qa, testnet, mainnet]
environment: ${{ matrix.environment }}
steps:
- name: Checkout code
uses: actions/checkout@v4
Expand Down Expand Up @@ -38,9 +42,22 @@ jobs:
echo "NEXT_PUBLIC_WEB3_CLIENT_ID=${{ secrets.NEXT_PUBLIC_WEB3_CLIENT_ID }}" >> .env
cat .env
- name: Get the Git tag
id: get_tag
run: echo "GIT_TAG=$(echo ${GITHUB_REF#refs/tags/})" >> $GITHUB_ENV

- name: Build and push with github release tag
if: matrix.environment == 'mainnet' && startsWith(github.ref, 'refs/tags/')
uses: docker/build-push-action@v6
with:
context: .
push: true
tags: lifted/manifest-app:${{ env.GIT_TAG }}

- name: Build and push Docker image
if: github.ref == 'refs/heads/main'
uses: docker/build-push-action@v6
with:
context: .
push: true
tags: lifted/manifest-app:testnet
tags: lifted/manifest-app:${{ matrix.environment }}

0 comments on commit b3904e3

Please sign in to comment.