ADD: external badge for open PRs #8
Workflow file for this run
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
name: release | |
on: | |
push: | |
# run only against version tags | |
tags: | |
- 'v*' | |
permissions: | |
contents: write | |
packages: write | |
jobs: | |
release: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v2 | |
with: | |
fetch-depth: 0 | |
- name: Fetch all tags | |
run: git fetch --force --tags | |
- name: Set some env vars for the build | |
run: | | |
TIMESTAMP=$(date -u +%Y-%m-%dT%H:%M:%SZ) | |
echo "COMMIT=${GITHUB_SHA:0:7}" >> $GITHUB_ENV | |
echo "LASTMOD=${TIMESTAMP}" >> $GITHUB_ENV | |
echo "BUILTBY=build.yaml" >> $GITHUB_ENV | |
echo "IMAGE_NAME=fileformat/ghashboard" >> $GITHUB_ENV | |
echo "VERSION=${GITHUB_REF#refs/tags/v}" >> $GITHUB_ENV | |
- name: Login to GitHub Container Registry | |
uses: docker/login-action@v3 | |
with: | |
registry: ghcr.io | |
username: ${{ github.actor }} | |
password: ${{ secrets.GITHUB_TOKEN }} | |
- name: Build and push | |
uses: docker/build-push-action@v5 | |
with: | |
context: . | |
file: ./Dockerfile | |
push: true | |
tags: | | |
ghcr.io/${{ env.IMAGE_NAME }}:${{ env.VERSION }} | |
ghcr.io/${{ env.IMAGE_NAME }}:latest | |
build-args: | | |
COMMIT=${{ env.COMMIT }} | |
LASTMOD=${{ env.LASTMOD }} | |
VERSION=${{ env.VERSION }} | |
BUILTBY=${{ env.BUILTBY }} | |
- name: Set up Go | |
uses: actions/setup-go@v2 | |
with: | |
go-version: 1.22.1 | |
- name: Run GoReleaser | |
uses: goreleaser/goreleaser-action@v2 | |
with: | |
distribution: goreleaser | |
version: latest | |
args: release --clean | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |