130 lines
4.2 KiB
YAML
130 lines
4.2 KiB
YAML
# build and push docker image to docker hub
|
|
name: Build & Deploy Dev
|
|
|
|
on:
|
|
push:
|
|
branches:
|
|
- "dev"
|
|
- "main"
|
|
|
|
env:
|
|
IMAGE_NAME: rss3/xlog
|
|
REGION_ID: us-east-1
|
|
ACK_CLUSTER_ID: cd1d0ffc40b5242b39ddda1864e71e30d
|
|
|
|
jobs:
|
|
build-dev:
|
|
if: github.ref == 'refs/heads/dev'
|
|
runs-on: ubuntu-latest
|
|
environment: Preview
|
|
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 }}"
|
|
|
|
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
|
|
needs:
|
|
- build
|
|
with:
|
|
images: rss3/xlog
|
|
tag: dev-${{ github.sha }}
|
|
cluster: dev
|
|
namespace: crossbell
|
|
releaseName: xlog
|
|
revision: dev
|
|
dir: deploy/dev
|
|
secrets:
|
|
GOOGLE_CREDENTIALS: ${{ secrets.GOOGLE_CREDENTIALS }}
|
|
deploy-prod:
|
|
if: github.ref == 'refs/heads/main'
|
|
uses: NaturalSelectionLabs/Daedalus/.github/workflows/deploy-v3-tpl.yaml@main
|
|
needs:
|
|
- build
|
|
with:
|
|
images: rss3/xlog
|
|
tag: main-${{ github.sha }}
|
|
cluster: prod
|
|
namespace: crossbell
|
|
releaseName: xlog
|
|
revision: main
|
|
dir: deploy/prod
|
|
secrets:
|
|
GOOGLE_CREDENTIALS: ${{ secrets.GOOGLE_CREDENTIALS }}
|