Skip to content

Commit af9d8a0

Browse files
committed
Create GHCR Image Build Workflow
1 parent 5d5fb23 commit af9d8a0

File tree

1 file changed

+42
-0
lines changed

1 file changed

+42
-0
lines changed

.github/workflows/build.yaml

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
name: Build and Push Docker Image
2+
3+
on: [push, pull_request]
4+
5+
jobs:
6+
build-and-push:
7+
runs-on: ubuntu-latest
8+
9+
permissions:
10+
contents: read
11+
packages: write
12+
id-token: write
13+
14+
steps:
15+
- name: Check out code
16+
uses: actions/checkout@v4
17+
18+
- name: Generate Image Metadata
19+
id: meta
20+
uses: docker/metadata-action@v5
21+
with:
22+
images: ghcr.io/${{ github.repository }}
23+
flavor: |
24+
latest=true
25+
tags: |
26+
type=sha,format=long
27+
28+
- name: Log in to GitHub Container Registry
29+
uses: docker/login-action@v3
30+
with:
31+
registry: ghcr.io
32+
username: ${{ github.actor }}
33+
password: ${{ secrets.GITHUB_TOKEN }}
34+
35+
- name: Build and Push Docker Remix Image
36+
uses: docker/build-push-action@v5
37+
with:
38+
context: ./
39+
file: Dockerfile
40+
push: true
41+
tags: ${{ steps.meta.outputs.tags }}
42+
labels: ${{ steps.meta.outputs.labels }}

0 commit comments

Comments
 (0)