Skip to content

Commit 8c50dc5

Browse files
committed
build and push backend image from backend
1 parent b0fe71e commit 8c50dc5

1 file changed

Lines changed: 34 additions & 1 deletion

File tree

.github/workflows/ci.yml

Lines changed: 34 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,40 @@ jobs:
3535
uses: actions/upload-pages-artifact@v3
3636
with:
3737
path: 'web/build/'
38-
38+
39+
build-backend-image:
40+
name: Build
41+
runs-on: ubuntu-latest
42+
permissions:
43+
packages: write
44+
steps:
45+
- uses: actions/checkout@v4
46+
- name: Log in to the Container registry
47+
uses: docker/login-action@v3.3.0
48+
with:
49+
registry: ghcr.io
50+
username: ${{ github.actor }}
51+
password: ${{ secrets.GITHUB_TOKEN }}
52+
53+
# Needed to use gha caching
54+
- name: Docker Setup Buildx
55+
uses: docker/setup-buildx-action@v3.10.0
56+
with:
57+
driver: docker-container
58+
driver-opts: image=moby/buildkit:master,network=host
59+
60+
- name: Build and push Docker image
61+
uses: docker/build-push-action@v4
62+
if: github.event.repository.fork == false && github.ref_name == 'main'
63+
with:
64+
context: .
65+
file: backend.Dockerfile
66+
push: true
67+
cache-from: type=gha
68+
cache-to: type=gha,mode=max
69+
tags: |
70+
ghcr.io/itrooz/modpackcreator/backend:latest
71+
3972
upload_pages:
4073
name: Deploy to GitHub Pages
4174
runs-on: ubuntu-latest

0 commit comments

Comments
 (0)