wg-easy/.github/workflows/deploy.yml

43 lines
1.1 KiB
YAML
Raw Normal View History

2023-12-18 05:23:04 +08:00
name: Build & Publish Docker Image to GitHub Container Registry
2021-05-23 18:38:39 +08:00
on:
workflow_dispatch:
push:
branches:
- production
jobs:
deploy:
name: Build & Deploy
runs-on: ubuntu-latest
2023-12-18 05:31:58 +08:00
permissions:
packages: write
contents: read
2021-05-23 18:38:39 +08:00
steps:
2023-12-18 05:31:58 +08:00
- uses: actions/checkout@v4
2021-07-14 03:54:14 +08:00
with:
2021-07-14 03:55:12 +08:00
ref: production
2021-05-23 18:38:39 +08:00
- name: Set up QEMU
uses: docker/setup-qemu-action@v1
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1
2023-12-18 05:19:52 +08:00
- name: Login to GitHub Container Registry
2023-12-18 05:31:58 +08:00
uses: docker/login-action@v3
2021-05-23 18:38:39 +08:00
with:
2023-12-18 05:19:52 +08:00
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
2021-05-23 18:38:39 +08:00
2023-12-18 05:23:04 +08:00
- name: Set environment variables
run: echo RELEASE=$(cat ./src/package.json | jq -r .release) >> $GITHUB_ENV
2021-05-23 18:38:39 +08:00
- name: Build & Publish Docker Image
2023-12-18 05:31:58 +08:00
uses: docker/build-push-action@v5
2021-05-23 18:38:39 +08:00
with:
push: true
2021-05-23 20:32:10 +08:00
platforms: linux/amd64,linux/arm/v6,linux/arm/v7,linux/arm64/v8
2023-12-18 05:27:27 +08:00
tags: ghcr.io/wg-easy/wg-easy:latest, ghcr.io/wg-easy/wg-easy:${{ env.RELEASE }}