jackchuong is building frontend 🚀 #17
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: build frontend | |
run-name: ${{ github.actor }} is building frontend 🚀 | |
on: | |
workflow_dispatch: | |
# Some objects are defined but never used lead to warnings when build | |
# Treating warnings as errors because process.env.CI = true ==> step build api exit code 1 and fail | |
# temporary fix by set process.env.CI = false | |
env: | |
CI: false | |
jobs: | |
build-push-docker-image: | |
runs-on: ubuntu-latest | |
environment: | |
name: mainnet | |
steps: | |
- run: echo "🎉 The job was automatically triggered by a ${{ github.event_name }} event." | |
- run: echo "🐧 This job is now running on a ${{ runner.os }} server hosted by GitHub!" | |
- run: echo "🔎 The name of your branch is ${{ github.ref }} and your repository is ${{ github.repository }}." | |
- name: Check out repository code | |
uses: actions/checkout@v3 | |
- name: Generate .env file for web | |
uses: SpicyPizza/create-envfile@v2.0 | |
with: | |
envkey_NEXT_PUBLIC_IS_MAINNET: ${{ vars.NEXT_PUBLIC_IS_MAINNET }} | |
envkey_NEXT_PUBLIC_LOGIN_URL: ${{ vars.NEXT_PUBLIC_LOGIN_URL }} | |
envkey_NEXT_PUBLIC_API_URL: ${{ vars.NEXT_PUBLIC_API_URL }} | |
envkey_NEXT_PUBLIC_RENEW_ACCESS_TOKEN_URL: ${{ vars.NEXT_PUBLIC_RENEW_ACCESS_TOKEN_URL }} | |
envkey_NEXT_PUBLIC_LOGOUT_URL: ${{ vars.NEXT_PUBLIC_LOGOUT_URL }} | |
envkey_NEXT_PUBLIC_CARDANO_SCAN_URL: ${{ vars.NEXT_PUBLIC_CARDANO_SCAN_URL }} | |
#envkey_REACT_APP_DONATE_ADDRESS: ${{ vars.REACT_APP_DONATE_ADDRESS }} | |
envkey_NEXT_PUBLIC_CARDANO_EXPLORER_MAINNET_URL: ${{ vars.NEXT_PUBLIC_CARDANO_EXPLORER_MAINNET_URL }} | |
directory: . | |
file_name: .env | |
fail_on_empty: false | |
#- name: Copy .env file to jsk , emp | |
- name: Copy .env file to web | |
run: | | |
#cp .env cms/ | |
#cp .env jsk/ | |
cp .env web/ | |
rm -f .env | |
#echo "cat jsk/.env" | |
#cat jsk/.env | |
echo "cat web/.env" | |
cat web/.env | |
- name: Generate .env file for cms | |
uses: SpicyPizza/create-envfile@v2.0 | |
with: | |
envkey_NEXT_PUBLIC_IS_MAINNET: ${{ vars.NEXT_PUBLIC_IS_MAINNET }} | |
envkey_NEXT_PUBLIC_LOGIN_URL: ${{ vars.NEXT_PUBLIC_LOGIN_URL_CMS }} | |
envkey_NEXT_PUBLIC_API_URL: ${{ vars.NEXT_PUBLIC_API_URL }} | |
envkey_NEXT_PUBLIC_RENEW_ACCESS_TOKEN_URL: ${{ vars.NEXT_PUBLIC_RENEW_ACCESS_TOKEN_URL }} | |
envkey_NEXT_PUBLIC_LOGOUT_URL: ${{ vars.NEXT_PUBLIC_LOGOUT_URL }} | |
envkey_NEXT_PUBLIC_CARDANO_SCAN_URL: ${{ vars.NEXT_PUBLIC_CARDANO_SCAN_URL }} | |
envkey_NEXT_PUBLIC_WALLET_LOGIN_URL: ${{ vars.NEXT_PUBLIC_WALLET_LOGIN_URL }} | |
envkey_NEXT_PUBLIC_CARDANO_EXPLORER_MAINNET_URL: ${{ vars.NEXT_PUBLIC_CARDANO_EXPLORER_MAINNET_URL }} | |
directory: . | |
file_name: .env_cms | |
fail_on_empty: false | |
- name: Copy .env file to cms | |
run: | | |
cp .env_cms cms/.env | |
rm -f .env_cms | |
echo "cat cms/.env" | |
cat cms/.env | |
- name: Set up QEMU | |
uses: docker/setup-qemu-action@v2 | |
- name: Set up Docker Buildx | |
uses: docker/setup-buildx-action@v2 | |
- name: Login to Docker Hub | |
uses: docker/login-action@v3 | |
with: | |
registry: 121427815363.dkr.ecr.ap-southeast-1.amazonaws.com/bworks | |
username: ${{ secrets.AWS_ACCESS_KEY_ID }} | |
password: ${{ secrets.AWS_SECRET_ACCESS_KEY }} | |
#username: ${{ secrets.DOCKERHUB_USERNAME }} | |
#password: ${{ secrets.DOCKERHUB_TOKEN }} | |
- name: Build and push | |
uses: docker/build-push-action@v4 | |
with: | |
push: true | |
tags: ${{ vars.FRONTEND_MAINNET_TAG }} | |
#tags: 121427815363.dkr.ecr.ap-southeast-1.amazonaws.com/bworks:frontend-testnet | |
#tags: jackchuong/itl:bworks-frontend-testnet | |
context: . | |
file: ./docker-configs/Dockerfile-frontend | |
- run: echo "🍏 This job's status is ${{ job.status }}." |