-
Notifications
You must be signed in to change notification settings - Fork 1
38 lines (31 loc) · 1.12 KB
/
Copy pathdocker.yml
File metadata and controls
38 lines (31 loc) · 1.12 KB
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
name: Build and Push
on:
push:
branches: [master]
pull_request:
branches: [master]
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Build image
run: docker build -t wurstscript:ci .
- name: Smoke test
run: |
docker run --rm wurstscript:ci bash -c "
command -v grill || (echo 'grill not found' && exit 1)
ls /home/wurstuser/.wurst/wurst-compiler/wurstscript.jar || (echo 'wurstscript.jar not found' && exit 1)
echo 'All checks passed'
"
- name: Log in to Docker Hub
if: github.event_name == 'push' && github.ref == 'refs/heads/master'
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Push to Docker Hub
if: github.event_name == 'push' && github.ref == 'refs/heads/master'
run: |
docker tag wurstscript:ci ${{ secrets.DOCKERHUB_USERNAME }}/wurstscript:latest
docker push ${{ secrets.DOCKERHUB_USERNAME }}/wurstscript:latest