-
Notifications
You must be signed in to change notification settings - Fork 0
34 lines (32 loc) · 900 Bytes
/
build.yaml
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
name: Build docker image and push to Artifact Registry
on:
push:
branches:
- main
workflow_dispatch:
jobs:
image:
permissions:
contents: read
packages: write
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Create Tag SHA
id: create-tag-sha
run: |
echo ${{ github.sha }} | cut -c 1-7 | awk '{print "sha="$0}' >> $GITHUB_OUTPUT
- name: Login to GitHub Container Registry
uses: docker/login-action@v3
with:
registory: ghcr.io
username: irori235
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build and push
uses: docker/build-push-action@v5
with:
context: .
push: true
tags: |
ghcr.io/irori235/portfolio:latest
ghcr.io/irori235/portfolio:${{ steps.create-tag-sha.outputs.sha }}