-
Notifications
You must be signed in to change notification settings - Fork 0
53 lines (52 loc) · 1.41 KB
/
docker.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: Docker Build
on:
push:
branches:
- "master"
paths-ignore:
- "**.md"
workflow_dispatch:
schedule:
- cron: "0 6/12 * * *"
jobs:
docker:
name: Build Docker Image
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Log in to ghcr
uses: docker/login-action@v1
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Fetch Version
run: |-
echo "VERSION=$(sh ./scripts/version.sh)" >> $GITHUB_ENV
- run: sh ./scripts/version.sh
- name: Build & Push
uses: docker/build-push-action@v2
with:
push: true
no-cache: false
tags: |
ghcr.io/zekrotja/factorio:latest
ghcr.io/zekrotja/factorio:${{ env.VERSION }}
print_current_version:
name: "Print Current Version"
runs-on: ubuntu-latest
needs:
- docker
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Echo Version
run: |-
echo $(bash scripts/version.sh) > current_version.txt
- name: Commit & Push
uses: actions-js/push@master
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
message: update current version
branch: master