2021-07-30 02:01:46 +08:00
|
|
|
name: Publish on Docker
|
|
|
|
|
|
|
|
on:
|
|
|
|
# Shows the manual trigger in GitHub UI
|
|
|
|
# helpful as a back-up in case the GitHub Actions Workflow fails
|
|
|
|
workflow_dispatch:
|
|
|
|
|
|
|
|
release:
|
2022-02-11 09:40:41 +08:00
|
|
|
types:
|
|
|
|
- released
|
2021-07-30 02:01:46 +08:00
|
|
|
|
2022-03-02 07:03:39 +08:00
|
|
|
# Cancel in-progress runs for pull requests when developers push
|
|
|
|
# additional changes, and serialize builds in branches.
|
|
|
|
# https://docs.github.com/en/actions/using-jobs/using-concurrency#example-using-concurrency-to-cancel-any-in-progress-job-or-run
|
|
|
|
concurrency:
|
|
|
|
group: ${{ github.workflow }}-${{ github.ref }}
|
|
|
|
cancel-in-progress: ${{ github.event_name == 'pull_request' }}
|
|
|
|
|
2021-07-30 02:01:46 +08:00
|
|
|
jobs:
|
|
|
|
docker-images:
|
2022-02-11 09:40:41 +08:00
|
|
|
runs-on: ubuntu-20.04
|
2021-07-30 02:01:46 +08:00
|
|
|
steps:
|
2022-02-11 09:40:41 +08:00
|
|
|
- name: Checkout
|
2022-03-02 07:31:32 +08:00
|
|
|
uses: actions/checkout@v3
|
2021-07-30 02:01:46 +08:00
|
|
|
|
|
|
|
- name: Set up QEMU
|
|
|
|
uses: docker/setup-qemu-action@v1
|
|
|
|
|
|
|
|
- name: Set up Docker Buildx
|
|
|
|
uses: docker/setup-buildx-action@v1
|
|
|
|
|
2022-02-11 09:40:41 +08:00
|
|
|
- name: Login to Docker Hub
|
|
|
|
uses: docker/login-action@v1
|
|
|
|
with:
|
|
|
|
username: ${{ secrets.DOCKER_USERNAME }}
|
|
|
|
password: ${{ secrets.DOCKER_PASSWORD }}
|
|
|
|
|
2022-03-18 02:52:39 +08:00
|
|
|
- name: Get version
|
|
|
|
id: version
|
2022-03-23 07:45:59 +08:00
|
|
|
run: echo "::set-output name=version::$(jq -r .version package.json)"
|
2022-03-18 02:52:39 +08:00
|
|
|
|
|
|
|
- name: Download artifact
|
|
|
|
uses: dawidd6/action-download-artifact@v2
|
|
|
|
id: download
|
|
|
|
with:
|
|
|
|
branch: v${{ steps.version.outputs.version }}
|
2022-03-23 07:45:59 +08:00
|
|
|
workflow: ci.yaml
|
2022-03-18 02:52:39 +08:00
|
|
|
workflow_conclusion: completed
|
|
|
|
name: "release-packages"
|
|
|
|
path: release-packages
|
|
|
|
|
2021-07-30 02:01:46 +08:00
|
|
|
- name: Run ./ci/steps/docker-buildx-push.sh
|
|
|
|
run: ./ci/steps/docker-buildx-push.sh
|
|
|
|
env:
|
2022-02-11 09:40:41 +08:00
|
|
|
GITHUB_TOKEN: ${{ github.token }}
|