-
-
Notifications
You must be signed in to change notification settings - Fork 34
70 lines (70 loc) · 2.62 KB
/
pr-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
name: Automatic release from PR
on:
pull_request:
types: [labeled]
jobs:
merge-and-release:
env:
BASENAME: panard/mtgo
name: Merge and release
if: contains(github.event.pull_request.labels.*.name, 'merge-and-release')
runs-on: ubuntu-latest
steps:
- name: Dump GitHub context
env:
GITHUB_CONTEXT: ${{ toJson(github) }}
run: echo "$GITHUB_CONTEXT"
- name: Tags
run: |
echo PR_TAG=pr${{ github.event.pull_request.number }} >> $GITHUB_ENV
echo TIMESTAMP=$(date +%F) >> $GITHUB_ENV
- name: Login to docker hub
uses: actions-hub/docker/login@master
env:
DOCKER_USERNAME: ${{ secrets.DOCKER_USERNAME }}
DOCKER_PASSWORD: ${{ secrets.DOCKER_PASSWORD }}
- name: Pull image
uses: actions-hub/docker@master
with:
args: pull $BASENAME:$PR_TAG
- name: automerge
uses: pascalgn/automerge-action@v0.14.2
env:
GITHUB_TOKEN: ${{ secrets.PAT }}
MERGE_LABELS: ""
MERGE_METHOD: "rebase"
- uses: actions/checkout@v2
with:
ref: master
- name: Git tag
run: |
git tag $TIMESTAMP
git push --tags https://${GITHUB_ACTOR}:${{ secrets.PAT }}@github.com/${GITHUB_REPOSITORY}.git HEAD:master
echo WINE_TAG=wine-$(grep FROM Dockerfile|cut -d: -f2) >> $GITHUB_ENV
- run: |
docker tag $BASENAME:$PR_TAG $BASENAME:$TIMESTAMP
docker tag $BASENAME:$PR_TAG $BASENAME:$WINE_TAG
- name: Push image :timestamp
uses: actions-hub/docker@master
with:
args: push $BASENAME:$TIMESTAMP
- name: Push image :wine
uses: actions-hub/docker@master
with:
args: push $BASENAME:$WINE_TAG
- run: docker tag $BASENAME:$PR_TAG $BASENAME:latest
- name: Push image :latest
uses: actions-hub/docker@master
with:
args: push $BASENAME:latest
- name: Update sound image
run: docker build -t $BASENAME:sound sound
- name: Push image :sound
uses: actions-hub/docker@master
with:
args: push $BASENAME:sound
default:
name: default
runs-on: ubuntu-latest
steps:
- run: echo 1