-
Notifications
You must be signed in to change notification settings - Fork 0
37 lines (32 loc) · 1.06 KB
/
build-and-push.yml
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
name: Build Docker Image
on:
push:
tags:
- '*'
jobs:
build-docker-image:
runs-on: ubuntu-latest
steps:
# Fetch all repository details (Including tag for semver).
- uses: actions/checkout@v3
# Login to DockerHub by using the credentials.
- name: Login to GitHub Container Registry
uses: docker/login-action@v2
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}
# Setup BuildX
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
# Build Docker Image and push to docker hub.
- name: Build and push Docker image
uses: docker/build-push-action@v5.1.0
with:
context: .
push: true
tags: ${{ format('ghcr.io/resource-aware-jds/example-dedicated-repo:{0}', github.ref_name) }},ghcr.io/resource-aware-jds/example-dedicated-repo:latest
github-token: ${{ secrets.GITHUB_TOKEN }}
platforms: |
linux/amd64
linux/arm64