1
1
Fork 0
mirror of https://github.com/joshdk/drone-skip-pipeline synced 2024-05-07 19:06:02 +02:00

ci: workflows for master and tags (#10)

This commit is contained in:
Josh Komoroske 2021-11-14 18:03:10 -08:00 committed by GitHub
parent 92bfbcb2c0
commit d6844517de
Signed by: GitHub
GPG Key ID: 4AEE18F83AFDEB23

43
.github/workflows/release.yml vendored Normal file
View File

@ -0,0 +1,43 @@
name: Release
on:
push:
branches:
- "master"
tags:
- "v*.*.*"
- "v*.*.*-rc*"
jobs:
build:
name: Release
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
steps:
- name: Checkout code
uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Docker login
uses: docker/login-action@v1
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Docker build and push
run: |
image_name=ghcr.io/joshdk/drone-skip-pipeline
image_label="$(git describe --tags)"
docker build \
--build-arg CREATED="$(date -u +'%Y-%m-%dT%H:%M:%SZ')" \
--build-arg REVISION="$(git rev-parse HEAD)" \
--build-arg VERSION="$image_label" \
--tag "$image_name:$image_label" \
.
docker push "$image_name:$image_label"