add: 中信银行信用卡外呼服务热线 #50
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: Release | |
on: | |
push: | |
branches: [ "master" ] | |
paths: | |
- "data/**" | |
workflow_dispatch: | |
env: | |
APP_NAME: vcards | |
jobs: | |
release-build: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- name: Git status | |
run: | | |
git status | |
ls -lah | |
- name: Set up QEMU | |
uses: docker/setup-qemu-action@v3 | |
- name: Set up docker buildx | |
uses: docker/setup-buildx-action@v3 | |
- name: Login to DockerHub | |
uses: docker/login-action@v3 | |
with: | |
username: ${{ secrets.DOCKERHUB_USERNAME }} | |
password: ${{ secrets.DOCKERHUB_TOKEN }} | |
- name: Login to GHCR | |
uses: docker/login-action@v3 | |
with: | |
registry: ghcr.io | |
username: ${{ github.repository_owner }} | |
password: ${{ secrets.GITHUB_TOKEN }} | |
- name: Generate app version | |
run: echo "APP_VERSION=$(date +'%y%m%d')" >> $GITHUB_ENV | |
- name: Set GHCR username | |
run: | | |
echo "GITHUB_USER=${GITHUB_REPOSITORY,,}" >> $GITHUB_ENV | |
- name: Pre Build | |
run: | | |
yarn install | |
yarn build | |
- name: Docker build and push | |
uses: docker/build-push-action@v5 | |
env: | |
DOCKER_USER: ${{ secrets.DOCKERHUB_USERNAME }} | |
with: | |
push: true | |
# https://github.com/docker/build-push-action/issues/513 | |
context: . | |
platforms: | | |
linux/amd64 | |
linux/arm64/v8 | |
build-args: | | |
APP_NAME=${{ env.APP_NAME }} | |
APP_VERSION=${{ env.APP_VERSION }} | |
tags: | | |
ghcr.io/${{ env.GITHUB_USER }}/${{ env.APP_NAME }}:latest | |
ghcr.io/${{ env.GITHUB_USER }}/${{ env.APP_NAME }}:${{ env.APP_VERSION }} | |
${{ env.DOCKER_USER }}/${{ env.APP_NAME }}:latest | |
${{ env.DOCKER_USER }}/${{ env.APP_NAME }}:${{ env.APP_VERSION }} |