-
Notifications
You must be signed in to change notification settings - Fork 2
45 lines (37 loc) · 1.74 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
name: Release new version
on:
push:
tags:
- "v*"
jobs:
release:
runs-on: ubuntu-latest
steps:
- name: "Checkout repository"
uses: actions/checkout@v3
- name: Parse tag
id: parse_tag
run: "echo \"version=$(echo ${{ github.ref }} | sed 's#^refs/tags/v##')\" >> $GITHUB_OUTPUT"
- name: Create release draft
id: create_release
uses: release-drafter/release-drafter@v5
with:
name: v${{ steps.parse_tag.outputs.version }}
tag: v${{ steps.parse_tag.outputs.version }}
version: v${{ steps.parse_tag.outputs.version }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Build new images
run: |
docker build . --file Dockerfile.bot -t ghcr.io/tibo-ulens/freud_bot:${{ steps.parse_tag.outputs.version }}
docker build . --file Dockerfile.webconfig -t ghcr.io/tibo-ulens/freud_bot_webconfig:${{ steps.parse_tag.outputs.version }}
- name: Log in to ghcr
run: echo ${{ secrets.GITHUB_TOKEN }} | docker login ghcr.io -u $GITHUB_ACTOR --password-stdin
- name: Tag new images as latest
run: |
docker tag ghcr.io/tibo-ulens/freud_bot:${{ steps.parse_tag.outputs.version }} ghcr.io/tibo-ulens/freud_bot:latest
docker tag ghcr.io/tibo-ulens/freud_bot_webconfig:${{ steps.parse_tag.outputs.version }} ghcr.io/tibo-ulens/freud_bot_webconfig:latest
- name: Push new images
run: |
docker push --all-tags ghcr.io/tibo-ulens/freud_bot
docker push --all-tags ghcr.io/tibo-ulens/freud_bot_webconfig