Skip to content

Commit dcfd5c4

Browse files
authored
Merge pull request #30 from musicEnfanthen/update-workflow
ci(gh-actions): harden actions
2 parents 2ba6c6c + 37c5a01 commit dcfd5c4

File tree

2 files changed

+38
-6
lines changed

2 files changed

+38
-6
lines changed

.github/dependabot.yml

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
version: 2
2+
updates:
3+
- package-ecosystem: github-actions
4+
directory: /
5+
schedule:
6+
interval: daily
7+
labels:
8+
- 'gh actions dependencies'
9+
10+
- package-ecosystem: docker
11+
directory: /
12+
schedule:
13+
interval: daily
14+
labels:
15+
- 'dependencies'
16+
17+
- package-ecosystem: npm
18+
directory: /
19+
schedule:
20+
interval: daily
21+
labels:
22+
- 'dependencies'

.github/workflows/dockerimage.yml

Lines changed: 16 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,9 @@ on:
1010
paths-ignore:
1111
- '**.md' # ignore changes in markdown files
1212

13+
permissions:
14+
contents: read
15+
1316
env:
1417
REGISTRY: ghcr.io
1518
IMAGE_NAME: ${{ github.repository }}
@@ -18,35 +21,42 @@ jobs:
1821
build-and-push-image:
1922
runs-on: ubuntu-22.04
2023
if: ${{ github.repository_owner == 'music-encoding' }}
24+
2125
permissions:
2226
contents: read
2327
packages: write
28+
2429
steps:
2530
- name: Checkout repository
26-
uses: actions/checkout@v3
31+
uses: actions/checkout@0ad4b8fadaa221de15dcec353f45205ec38ea70b # v4.1.4
32+
2733
- name: Set up QEMU
28-
uses: docker/setup-qemu-action@v2
34+
uses: docker/setup-qemu-action@68827325e0b33c7199eb31dd4e31fbe9023e06e3 # v3.0.0
35+
2936
- name: Set up Docker Buildx
30-
uses: docker/setup-buildx-action@v2
37+
uses: docker/setup-buildx-action@d70bba72b1f3fd22344832f00baa16ece964efeb # v3.3.0
38+
3139
- name: Login to GitHub Container Registry
3240
if: ${{ github.event_name == 'push' }}
33-
uses: docker/login-action@v2
41+
uses: docker/login-action@e92390c5fb421da1463c202d546fed0ec5c39f20 # v3.1.0
3442
with:
3543
registry: ${{ env.REGISTRY }}
3644
username: ${{ github.actor }}
3745
password: ${{ secrets.GITHUB_TOKEN }}
46+
3847
- name: MAIN – Build and push
3948
if: ${{ github.event_name == 'push' }}
40-
uses: docker/build-push-action@v4
49+
uses: docker/build-push-action@2cdde995de11925a030ce8070c3d77a52ffcf1c0 # v5.3.0
4150
with:
4251
context: .
4352
file: Dockerfile
4453
platforms: linux/amd64,linux/arm64
4554
push: true
4655
tags: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:latest
56+
4757
- name: PR – build only
4858
if: ${{ github.event_name == 'pull_request' }}
49-
uses: docker/build-push-action@v4
59+
uses: docker/build-push-action@2cdde995de11925a030ce8070c3d77a52ffcf1c0 # v5.3.0
5060
with:
5161
context: .
5262
file: Dockerfile

0 commit comments

Comments
 (0)