forked from project-sunbird/sunbird-report-service
-
Notifications
You must be signed in to change notification settings - Fork 0
38 lines (30 loc) · 865 Bytes
/
ghcr-publish.yml
File metadata and controls
38 lines (30 loc) · 865 Bytes
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
38
name: Build and Publish Docker Image
on:
push:
tags:
- 'release*'
jobs:
build-and-push:
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
id-token: write
steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: Log in to GitHub Container Registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Set up Docker image name
id: vars
run: echo "IMAGE_NAME=ghcr.io/${{ github.repository }}" >> $GITHUB_ENV
- name: Build Docker image
run: |
docker build -t $IMAGE_NAME:${{ github.ref_name }} .
- name: Push Docker image
run: |
docker push $IMAGE_NAME:${{ github.ref_name }}