-
Notifications
You must be signed in to change notification settings - Fork 0
90 lines (74 loc) · 2.32 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
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
83
84
85
86
87
88
89
90
name: Release
on:
push:
branches:
- main
- beta
- betatest
jobs:
build-test-release:
runs-on: [gpu]
steps:
- name: Define environment variables
run: echo IMAGE_NAME=ghcr.io/$(echo ${{ github.repository }} | tr '[:upper:]' '[:lower:]') >> $GITHUB_ENV
- name: Checkout code
uses: actions/checkout@v4
with:
fetch-depth: 0 # Important for Semantic Release to analyze all commits
- name: Setup Node.js
uses: actions/setup-node@v3
with:
node-version: "lts/*"
- run: npm install semantic-release-replace-plugin -D
- name: Create semantic release
uses: cycjimmy/semantic-release-action@v4
id: semantic
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Checkout new release
if: steps.semantic.outputs.new_release_published == 'true'
uses: actions/checkout@v4
with:
ref: ${{ steps.semantic.outputs.new_release_git_tag }}
deploy:
# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages
permissions:
contents: read
pages: write
id-token: write
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
runs-on: ubuntu-latest
needs: build-test-release
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
ref: ${{ github.ref }}
- name: Update esi-shell version
run: |
sed -i "/^ESI_SHELL_VERSION=/ s/$/-$(git rev-parse --short HEAD)/" esi-shell
- name: Setup Pages
uses: actions/configure-pages@v5
- name: Build with Jekyll
uses: actions/jekyll-build-pages@v1
- name: Upload artifact
uses: actions/upload-pages-artifact@v3
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4
cleanup:
runs-on: ubuntu-latest
needs: build-test-release
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Install python
uses: actions/setup-python@v5
with:
python-version: '3.12'
- name: Delete untagged images
run: |
python -m pip install requests
.github/workflows/delete_untagged.py ${{ secrets.BNLNPPS_ESI_SHELL_PACKAGES_TOKEN }}