-
Notifications
You must be signed in to change notification settings - Fork 9
55 lines (42 loc) · 1.77 KB
/
build.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
name: Build Docker Container
on: push
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v2
- name: Get version name
shell: bash
run: echo "##[set-output name=name;]`echo ${GITHUB_REF#refs/tags/}`"
id: branch
if: startsWith(github.ref, 'refs/tags/')
- name: Build untagged Docker container
run: docker build .
if: startsWith(github.ref, 'refs/tags/') != true
- name: Build tagged Docker Container
run: docker build -t ractf/core:${{ steps.branch.outputs.name }} -t ghcr.io/ractf/core:${{ steps.branch.outputs.name }} -t ractf/core:latest -t ghcr.io/ractf/core:latest .
if: startsWith(github.ref, 'refs/tags/')
- name: Create Sentry release
uses: getsentry/action-release@v1
env:
SENTRY_AUTH_TOKEN: ${{ secrets.SENTRY_AUTH_TOKEN }}
SENTRY_ORG: ${{ secrets.SENTRY_ORG }}
SENTRY_PROJECT: ${{ secrets.SENTRY_PROJECT }}
if: startsWith(github.ref, 'refs/tags/')
- name: Login to Docker Hub
run: docker login --username ractf --password ${{ secrets.password }}
if: startsWith(github.ref, 'refs/tags/')
- name: Login to Github Container Registry
run: echo ${{ secrets.ghtoken }} | docker login ghcr.io -u ${{ secrets.ghuser }} --password-stdin
if: startsWith(github.ref, 'refs/tags/')
- name: Push to Docker Hub
run: |
docker push ractf/core:${{ steps.branch.outputs.name }}
docker push ractf/core:latest
if: startsWith(github.ref, 'refs/tags/')
- name: Push to Github Container Registry
run: |
docker push ghcr.io/ractf/core:${{ steps.branch.outputs.name }}
docker push ghcr.io/ractf/core:latest
if: startsWith(github.ref, 'refs/tags/')