-
Notifications
You must be signed in to change notification settings - Fork 5
47 lines (40 loc) · 1.44 KB
/
release.yml
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
name: Release
on:
workflow_dispatch:
inputs:
version:
description: 'The version of the release'
required: true
jobs:
release-cli-to-npm:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v2
- name: Setup NodeJS
uses: actions/setup-node@v1
with:
node-version: 16
registry-url: https://registry.npmjs.org/
- name: Publish CLI
run: cd cli && npm ci && npm publish
env:
NODE_AUTH_TOKEN: ${{secrets.npm_token}}
tag-docker-images:
runs-on: ubuntu-latest
steps:
- name: Login to GitHub Container Registry
run: echo "${{ secrets.CR_PAT }}" | docker login https://ghcr.io -u ${{ github.actor }} --password-stdin
- name: Tag latest images with release version
run: |
VERSION="@@@${{github.event.inputs.version}}@@@"
IMAGES="alex-frontend alex-backend alex-cli alex-docs"
for img in $IMAGES
do
echo "ghcr.io/learnlib/alex/$img:$VERSION"
docker pull "ghcr.io/learnlib/alex/$img:unstable"
docker tag "ghcr.io/learnlib/alex/$img:unstable" "ghcr.io/learnlib/alex/$img:$VERSION"
docker tag "ghcr.io/learnlib/alex/$img:unstable" "ghcr.io/learnlib/alex/$img:latest"
docker push "ghcr.io/learnlib/alex/$img:$VERSION"
docker push "ghcr.io/learnlib/alex/$img:latest"
done