forked from sentriz/gonic
-
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Pushes images to GitHub Container Registry (GHCR) to deprecate Docker Hub - Auto releases for nightly - Auto releases for new release
- Loading branch information
Showing
5 changed files
with
77 additions
and
25 deletions.
There are no files selected for viewing
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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" |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
name: Release | ||
on: | ||
push: | ||
branches: | ||
- master | ||
jobs: | ||
release-please: | ||
name: Run release-please | ||
runs-on: ubuntu-latest | ||
outputs: | ||
release_created: ${{ steps.release.outputs.release_created }} | ||
tag_name: ${{ steps.release.outputs.tag_name }} | ||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v2 | ||
- name: Setup release please | ||
uses: google-github-actions/release-please-action@v2 | ||
id: release | ||
with: | ||
token: ${{ secrets.GITHUB_TOKEN }} | ||
release-type: simple | ||
changelog-path: CHANGELOG.md | ||
package-name: gonic | ||
build-tag-publish: | ||
name: Build, tag, and publish Docker image | ||
if: ${{ needs.release-please.outputs.release_created }} | ||
needs: release-please | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v2 | ||
- name: Update version.go | ||
run: sed -Ei 's/VERSION = "v0.0.0"/VERSION = "${{ needs.release-please.outputs.tag_name }}"/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 | ||
if: ${{ needs.release-please.outputs.release_created }} | ||
run: | | ||
docker build \ | ||
-t "ghcr.io/${GITHUB_REPOSITORY}:${{ needs.release-please.outputs.tag_name }}" \ | ||
-t "ghcr.io/${GITHUB_REPOSITORY}:latest" . | ||
- name: Release Docker image | ||
run: | | ||
docker push "ghcr.io/${GITHUB_REPOSITORY}:${{ needs.release-please.outputs.tag_name }}" | ||
docker push "ghcr.io/${GITHUB_REPOSITORY}:latest" |
Empty file.
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