diff --git a/.github/workflows/docker-build-push.yaml b/.github/workflows/docker-build-push.yaml index dd7f1134..61570927 100644 --- a/.github/workflows/docker-build-push.yaml +++ b/.github/workflows/docker-build-push.yaml @@ -13,7 +13,8 @@ env: ACK_CLUSTER_ID: cd1d0ffc40b5242b39ddda1864e71e30d jobs: - build: + build-dev: + if: github.ref == 'refs/heads/dev' runs-on: ubuntu-latest environment: Preview outputs: @@ -54,6 +55,48 @@ jobs: "NEXT_PUBLIC_WALLET_CONNECT_V2_PROJECT_ID=${{ vars.NEXT_PUBLIC_WALLET_CONNECT_V2_PROJECT_ID }}" "NEXT_PUBLIC_IPFS_GATEWAY=${{ vars.NEXT_PUBLIC_IPFS_GATEWAY }}" + build-prod: + if: github.ref == 'refs/heads/main' + runs-on: ubuntu-latest + environment: Production + outputs: + version: ${{ steps.meta.outputs.version }} + steps: + - uses: hmarr/debug-action@v2 + - name: Checkout + uses: actions/checkout@v4 + - name: docker meta + id: meta + uses: docker/metadata-action@v5 + with: + images: rss3/xlog + tags: | + type=sha,prefix={{branch}}- + type=sha,format=long,prefix={{branch}}- + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v3 + - name: Login to DockerHub + if: github.event_name != 'pull_request' + uses: docker/login-action@v3 + with: + username: ${{ secrets.DOCKERHUB_USERNAME }} + password: ${{ secrets.DOCKERHUB_TOKEN }} + - name: Build and push + uses: docker/build-push-action@v5 + with: + context: . + file: Dockerfile + push: ${{ github.event_name != 'pull_request' }} + tags: ${{ steps.meta.outputs.tags }} + labels: ${{ steps.meta.outputs.labels }} + build-args: | + "NEXT_PUBLIC_DISCORD_LINK=${{ vars.NEXT_PUBLIC_DISCORD_LINK }}" + "NEXT_PUBLIC_GITHUB_LINK=${{ vars.NEXT_PUBLIC_GITHUB_LINK }}" + "NEXT_PUBLIC_OUR_DOMAIN=${{ vars.NEXT_PUBLIC_OUR_DOMAIN }}" + "NEXT_PUBLIC_TWITTER_LINK=${{ vars.NEXT_PUBLIC_TWITTER_LINK }}" + "NEXT_PUBLIC_WALLET_CONNECT_V2_PROJECT_ID=${{ vars.NEXT_PUBLIC_WALLET_CONNECT_V2_PROJECT_ID }}" + "NEXT_PUBLIC_IPFS_GATEWAY=${{ vars.NEXT_PUBLIC_IPFS_GATEWAY }}" + deploy-dev: if: github.ref == 'refs/heads/dev' uses: NaturalSelectionLabs/Daedalus/.github/workflows/deploy-v3-tpl.yaml@main