-
Notifications
You must be signed in to change notification settings - Fork 1
66 lines (55 loc) · 1.74 KB
/
ci.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
name: CI
on:
push:
branches: [master]
pull_request:
branches: [master]
jobs:
lint:
runs-on: ubuntu-latest
container: "koalaman/shellcheck-alpine:latest"
steps:
- name: Checkout
uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Run Shellcheck
# TODO(#35): fix bogus shellcheck errors in Github Actions
run: |
find . -type f -name '*.sh' | xargs shellcheck --external-sources --exclude=SC1091,SC2086
build:
runs-on: ubuntu-latest
strategy:
matrix:
distro: [arch]
steps:
- name: Checkout
uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Generate image tags
id: generate_image_tags
run: |
IMAGE_TAG_BASE="meatwallace/meatbox-${{ matrix.distro }}"
if [[ "${{ github.ref }}" = refs/heads/master ]]; then
TAGS="${IMAGE_TAG_BASE}:latest,"
fi
TAGS="$TAGS${IMAGE_TAG_BASE}:${{ github.sha }}"
echo "::set-output name=tags::${TAGS}"
- name: Log in to Dockerhub
uses: docker/login-action@v1
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Build container image
uses: docker/build-push-action@v2
with:
push: ${{ github.event_name != 'pull_request' }}
file: ./scripts/${{ matrix.distro }}/Dockerfile
build-args: |
"MEATBOX_USER=meatwallace"
"MEATBOX_PASSWORD=meatword"
"MEATBOX_CHECKOUT_SHA1=${{ github.sha }}"
tags: ${{ steps.generate_image_tags.outputs.tags }}
- name: Image digest
run: echo ${{ steps.docker_build.outputs.digest }}