-
Notifications
You must be signed in to change notification settings - Fork 0
47 lines (40 loc) · 1.32 KB
/
docker-build.yml
File metadata and controls
47 lines (40 loc) · 1.32 KB
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
39
40
41
42
43
44
45
46
47
name: Docker Build
on:
push:
branches:
- main
paths:
- 'Dockerfile*'
- '.github/workflows/docker-build.yml'
- 'requirements.txt'
permissions:
contents: read
packages: write
security-events: write
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd
- name: Lowercase Repo Name
run: |
# Converts rwilliamspbg-ops/Sovereign_Map_Federated_Learning to lowercase
echo "IMAGE_REPOSITORY=$(echo ${{ github.repository }} | tr '[:upper:]' '[:lower:]')" >> $GITHUB_ENV
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@4d04d5d9486b7bd6fa91e7baf45bbb4f8b9deedd
- name: Log in to GitHub Container Registry
uses: docker/login-action@4907a6ddec9925e35a0a9e82d7399ccc52663121
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build and Push Backend
uses: docker/build-push-action@bcafcacb16a39f128d818304e6c9c0c18556b85f
with:
context: .
file: ./Dockerfile
push: true
tags: |
ghcr.io/${{ env.IMAGE_REPOSITORY }}/backend:latest
ghcr.io/${{ env.IMAGE_REPOSITORY }}/backend:v0.4