1- # ---
2- # name: ci
1+ ---
2+ name : ci
33
4- # on:
5- # push:
6- # branches:
7- # - 'master'
8- # - 'main'
9- # pull_request:
10- # branches:
11- # - 'master'
12- # - 'main'
13- # workflow_dispatch:
14- # release:
15- # types: [published, edited]
4+ on :
5+ push :
6+ branches :
7+ - ' master'
8+ - ' main'
9+ pull_request :
10+ branches :
11+ - ' master'
12+ - ' main'
13+ workflow_dispatch :
14+ release :
15+ types : [published, edited]
1616
17- # jobs:
18- # build-and-push-images:
19- # runs-on: ubuntu-latest
20- # steps:
21- # -
22- # name: Checkout
23- # uses: actions/checkout@v2
24- # -
25- # name: Docker meta
26- # id: meta
27- # uses: docker/metadata-action@v3
28- # with:
29- # images: ghcr.io/netbox-community/Netbox-Device-Type-Library-Import
30- # tags: |
31- # type=raw,value=latest,enable=${{ endsWith(github.ref, github.event.repository.default_branch) }}
32- # type=ref,event=branch
33- # type=ref,event=pr
34- # type=semver,pattern={{version}}
35- # type=semver,pattern={{major}}
36- # type=semver,pattern={{major}}.{{minor}}
37- # - name: Set up QEMU
38- # uses: docker/setup-qemu-action@v1
39- # - name: Set up Docker Buildx
40- # uses: docker/setup-buildx-action@v1
41- # - name: Login to GitHub Container Registry
42- # if: github.event_name != 'pull_request'
43- # uses: docker/login-action@v1
44- # with:
45- # registry: ghcr.io
46- # username: ${{ github.repository_owner }}
47- # password: ${{ secrets.GITHUB_TOKEN }}
48- # - name: Build and push
49- # uses: docker/build-push-action@v2
50- # with:
51- # context: .
52- # push: ${{ github.event_name != 'pull_request' }}
53- # platforms: linux/amd64
54- # tags: ${{ steps.meta.outputs.tags }}
55- # labels: ${{ steps.meta.outputs.labels }}
17+ jobs :
18+ build-and-push-images :
19+ runs-on : ubuntu-latest
20+ steps :
21+ -
22+ name : Checkout
23+ uses : actions/checkout@v2
24+ -
25+ name : Docker meta
26+ id : meta
27+ uses : docker/metadata-action@v3
28+ with :
29+ images : |
30+ ghcr.io/minitriga/Netbox-Device-Type-Library-Import
31+ tags : |
32+ type=raw,value=latest,enable=${{ endsWith(github.ref, github.event.repository.default_branch) }}
33+ type=ref,event=branch
34+ type=ref,event=pr
35+ type=semver,pattern={{version}}
36+ type=semver,pattern={{major}}
37+ type=semver,pattern={{major}}.{{minor}}
38+ -
39+ name : Set up QEMU
40+ uses : docker/setup-qemu-action@v1
41+ -
42+ name : Set up Docker Buildx
43+ uses : docker/setup-buildx-action@v1
44+ -
45+ name : Login to GitHub Container Registry
46+ if : github.event_name != 'pull_request'
47+ uses : docker/login-action@v1
48+ with :
49+ registry : ghcr.io
50+ username : ${{ github.repository_owner }}
51+ password : ${{ secrets.GITHUB_TOKEN }}
52+ -
53+ name : Build and push
54+ uses : docker/build-push-action@v2
55+ with :
56+ context : .
57+ push : ${{ github.event_name != 'pull_request' }}
58+ platforms : linux/amd64
59+ tags : ${{ steps.meta.outputs.tags }}
60+ labels : ${{ steps.meta.outputs.labels }}
0 commit comments