-
Notifications
You must be signed in to change notification settings - Fork 6
82 lines (76 loc) · 2.82 KB
/
release.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
name: release
on:
push:
tags:
- "2023*"
workflow_dispatch:
inputs:
snapshot:
description: Force a dev version to be generated, implies dry_run.
type: boolean
required: true
dry_run:
description: Perform a dry-run release.
type: boolean
required: true
permissions:
# Required to publish a release
contents: write
# Necessary to push docker images to ghcr.io.
packages: write
env:
CODER_RELEASE: ${{ github.event.inputs.snapshot && 'false' || 'true' }}
jobs:
release:
runs-on: ubuntu-latest
env:
# Necessary for Docker manifest
DOCKER_CLI_EXPERIMENTAL: "enabled"
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
# If the event that triggered the build was an annotated tag (which our
# tags are supposed to be), actions/checkout has a bug where the tag in
# question is only a lightweight tag and not a full annotated tag. This
# command seems to fix it.
# https://github.com/actions/checkout/issues/290
- name: Fetch git tags
run: git fetch --tags --force
- name: Docker Login
uses: docker/#-action@v2
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- # Setting up Docker Buildx with docker-container driver is required
# at the moment to be able to use a subdirectory with Git context
name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
- name: GitHub Tag Name example
run: |
echo "Tag name from GITHUB_REF_NAME: $GITHUB_REF_NAME"
echo "Tag name from github.ref_name: ${{ github.ref_name }}"
# - name: Build and push iidoom
# uses: docker/build-push-action@v4
# with:
# context: "{{defaultContext}}:iidoom/build"
# push: true
# tags: "${{github.repository}}:iidoom-${{github.ref_name}}"
# https://github.com/marketplace/actions/push-to-ghcr
# - name: Build and publish a Docker image for ${{ github.repository }}
# uses: macbre/push-to-ghcr@master
# with:
# context: "iidoom/build"
# dockerfile: "iidoom/build/Dockerfile"
# image_name: ${{ github.repository_owner }}/iidoom # it will be lowercased internally
# image_tag: ${{ github.ref_name }}
# github_token: ${{ secrets.GITHUB_TOKEN }}
- name: Build and publish a Docker image for ${{ github.repository }}
uses: macbre/push-to-ghcr@master
with:
context: "iipod/build"
dockerfile: "iipod/build/Dockerfile"
image_name: ${{ github.repository_owner }}/iipod # it will be lowercased internally
image_tag: ${{ github.ref_name }}
github_token: ${{ secrets.GITHUB_TOKEN }}