-
-
Notifications
You must be signed in to change notification settings - Fork 1
40 lines (31 loc) · 1.02 KB
/
Copy pathdocker.yml
File metadata and controls
40 lines (31 loc) · 1.02 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
39
40
name: Build Arch Dev Image
on:
push:
paths:
- 'Dockerfile'
jobs:
build:
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
steps:
- uses: actions/checkout@v4
- name: Check for Dockerfile changes
id: changes
run: |
if git diff --name-only ${{ github.event.before }} ${{ github.sha }} | grep -q Dockerfile; then
echo "changed=true" >> $GITHUB_OUTPUT
else
echo "changed=false" >> $GITHUB_OUTPUT
fi
- name: Set lowercase owner
run: echo "OWNER=${GITHUB_REPOSITORY_OWNER,,}" >> $GITHUB_ENV
- name: Login to GHCR
run: echo "${{ secrets.GITHUB_TOKEN }}" | docker login ghcr.io -u ${{ github.actor }} --password-stdin
- name: Build
if: steps.changes.outputs.changed == 'true'
run: docker build -t ghcr.io/${OWNER}/arch-dev:latest .
- name: Push
if: steps.changes.outputs.changed == 'true'
run: docker push ghcr.io/${OWNER}/arch-dev:latest