forked from yongenaelf/aelfinity-workshop-devcontainer-image
-
Notifications
You must be signed in to change notification settings - Fork 0
53 lines (48 loc) · 1.62 KB
/
main.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
name: "build"
on: # rebuild any PRs and main branch changes
pull_request:
push:
branches:
- main
- alpha
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout (GitHub)
uses: actions/checkout@v3
- name: Test image builds correctly and is able to pass all tests
uses: devcontainers/[email protected]
with:
cacheFrom: ghcr.io/${{ github.repository_owner }}/aelfinity-workshop
push: never
runCmd: |
mkdir workshop &&
cd workshop &&
dotnet new aelf &&
cd src &&
dotnet build &&
cd ../test &&
dotnet test &&
aelf-command -v &&
aelf-deploy --version
- name: Semantic Release
uses: cycjimmy/semantic-release-action@v4
id: semantic
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Login to GitHub Container Registry
if: steps.semantic.outputs.new_release_published == 'true'
uses: docker/login-action@v2
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build and publish
if: steps.semantic.outputs.new_release_published == 'true'
uses: devcontainers/[email protected]
with:
imageName: ghcr.io/${{ github.repository_owner }}/aelfinity-workshop
cacheFrom: ghcr.io/${{ github.repository_owner }}/aelfinity-workshop
imageTag: ${{ steps.semantic.outputs.new_release_version }}${{ github.ref_name == 'main' && ',latest' || '' }}
push: always