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

49 lines
1.1 KiB
YAML
Raw Normal View History

2021-05-23 18:38:39 +08:00
name: Build & Publish Docker Image to Docker Hub
on:
workflow_dispatch:
push:
branches:
- testing
- testing/**
- staging
- staging/**
- production
- production/**
2021-05-27 16:00:54 +08:00
schedule:
- cron: "0 12 * * *"
2021-05-23 18:38:39 +08:00
jobs:
deploy:
name: Build & Deploy
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
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
- uses: benjlevesque/short-sha@v1.2
- name: Set up QEMU
uses: docker/setup-qemu-action@v1
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1
- name: Login to DockerHub
uses: docker/login-action@v1
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
# Set environment variables
2021-07-14 03:39:45 +08:00
- run: echo RELEASE=$(cat ./src/package.json | jq -r .release) >> $GITHUB_ENV
2021-05-23 18:38:39 +08:00
# Build & Publish
- name: Build & Publish Docker Image
uses: docker/build-push-action@v2
with:
push: true
2021-05-23 20:32:10 +08:00
platforms: linux/amd64,linux/arm/v6,linux/arm/v7,linux/arm64/v8
2021-07-14 03:39:45 +08:00
tags: weejewel/wg-easy:latest, weejewel/wg-easy:${{ env.RELEASE }}