feat(docker): add cn docker #17
Workflow file for this run
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: Create and publish a Docker image | |
# Configures this workflow to run every time a change is pushed to the branch called `release`. | |
on: | |
push: | |
branches: ['133-add-docker-support'] | |
jobs: | |
global-image-release: | |
runs-on: ubuntu-latest | |
environment: Develop | |
env: | |
XATA_API_KEY: ${{ secrets.XATA_API_KEY }} | |
XATA_FALLBACK_BRANCH: ${{ vars.XATA_FALLBACK_BRANCH }} | |
SENTRY_AUTH_TOKEN: ${{ secrets.SENTRY_AUTH_TOKEN }} | |
ENABLE_TRACK: ${{ vars.ENABLE_TRACK }} | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v4 | |
- name: Create Env | |
run: | | |
touch .env | |
echo NEXT_PUBLIC_REGION="GLOBAL" >>.env | |
echo XATA_API_KEY="$XATA_API_KEY" >> .env | |
echo XATA_FALLBACK_BRANCH="$XATA_FALLBACK_BRANCH" >> .env | |
echo SENTRY_AUTH_TOKEN="$SENTRY_AUTH_TOKEN" >> .env | |
echo ENABLE_TRACK="$ENABLE_TRACK" >> .env | |
- name: Login to ACR | |
uses: aliyun/acr-login@v1 | |
with: | |
login-server: https://registry.cn-hongkong.aliyuncs.com | |
username: "${{ secrets.REGISTRY_USERNAME }}" | |
password: "${{ secrets.REGISTRY_PASSWORD }}" | |
- name: Build and push image | |
env: | |
IMAGE_TAG: ${{ github.sha }} | |
run: | | |
docker build -t registry.cn-hongkong.aliyuncs.com/fec/web:$IMAGE_TAG -t registry.cn-hongkong.aliyuncs.com/fec/web:latest . | |
docker push registry.cn-hongkong.aliyuncs.com/fec/web:$IMAGE_TAG | |
docker push registry.cn-hongkong.aliyuncs.com/fec/web:latest | |
cn-image-release: | |
runs-on: ubuntu-latest | |
environment: Develop | |
env: | |
XATA_API_KEY: ${{ secrets.XATA_API_KEY }} | |
XATA_FALLBACK_BRANCH: ${{ vars.XATA_FALLBACK_BRANCH }} | |
SENTRY_AUTH_TOKEN: ${{ secrets.SENTRY_AUTH_TOKEN }} | |
ENABLE_TRACK: ${{ vars.ENABLE_TRACK }} | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v4 | |
- name: Create Env | |
run: | | |
touch .env | |
echo NEXT_PUBLIC_REGION="CN" >>.env | |
echo NEXT_PUBLIC_ENABLE_CN_DOMAIN="true" >>.env | |
echo XATA_API_KEY="$XATA_API_KEY" >> .env | |
echo XATA_FALLBACK_BRANCH="$XATA_FALLBACK_BRANCH" >> .env | |
echo SENTRY_AUTH_TOKEN="$SENTRY_AUTH_TOKEN" >> .env | |
echo ENABLE_TRACK="$ENABLE_TRACK" >> .env | |
- name: Login to ACR | |
uses: aliyun/acr-login@v1 | |
with: | |
login-server: https://registry.cn-hongkong.aliyuncs.com | |
username: "${{ secrets.REGISTRY_USERNAME }}" | |
password: "${{ secrets.REGISTRY_PASSWORD }}" | |
- name: Build and push image | |
env: | |
IMAGE_TAG: ${{ github.sha }} | |
run: | | |
docker build -t registry.cn-hongkong.aliyuncs.com/fec/cn-web:$IMAGE_TAG -t registry.cn-hongkong.aliyuncs.com/fec/cn-web:latest . | |
docker push registry.cn-hongkong.aliyuncs.com/fec/cn-web:$IMAGE_TAG | |
docker push registry.cn-hongkong.aliyuncs.com/fec/cn-web:latest |