feat(ci): use ghcr and auto release

- Pushes images to GitHub Container Registry (GHCR) to deprecate Docker Hub
- Auto releases for nightly
- Auto releases for new release
This commit is contained in:
Jef LeCompte
2021-04-13 09:07:09 -04:00
committed by sentriz
parent e6b76915da
commit c2c7eb249f
5 changed files with 77 additions and 25 deletions

27
.github/workflows/nightly-release.yaml vendored Normal file
View File

@@ -0,0 +1,27 @@
name: Nightly Release
on:
schedule:
- cron: '0 0 * * *'
workflow_dispatch: {}
jobs:
build-release:
name: Build and release Docker image
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v2
- name: Update version.go
run: |
_version=v$(cat version.txt)
sed -Ei "s/VERSION = \"v0.0.0\"/VERSION = \"${_version}-nightly\"/g" version/version.go
- name: Login into GitHub Container Registry
run: echo ${{ secrets.CR_PAT }} | docker login ghcr.io -u $GITHUB_ACTOR --password-stdin
- name: Build Docker image
run: |
docker build \
-t "ghcr.io/${GITHUB_REPOSITORY}:${GITHUB_SHA:0:7}" \
-t "ghcr.io/${GITHUB_REPOSITORY}:nightly" .
- name: Release Docker image
run: |
docker push "ghcr.io/${GITHUB_REPOSITORY}:${GITHUB_SHA:0:7}"
docker push "ghcr.io/${GITHUB_REPOSITORY}:nightly"