-
Notifications
You must be signed in to change notification settings - Fork 0
31 lines (31 loc) · 1.03 KB
/
app_dockerize.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
name: Dockerize latest version
on:
workflow_dispatch:
push:
branches: [main]
jobs:
dockerize_and_push:
name: Dockerize and push to GHCR
runs-on: ubuntu-latest
permissions:
packages: write
steps:
- uses: actions/checkout@v4
- name: Install Nixpacks
run: |
curl -LO https://github.com/railwayapp/nixpacks/releases/download/v1.21.1/nixpacks-v1.21.1-amd64.deb
sudo dpkg -i nixpacks-v1.21.1-amd64.deb
- name: Copy .env
run: cp .env.example .env
- name: Build image
run: nixpacks build .
- name: Login to GitHub Container Registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Tag image
run: docker tag $(docker images --format='{{.ID}}' | head -1) ghcr.io/palladians/supso:$(git rev-parse --short HEAD)
- name: Push to GHCR
run: docker push ghcr.io/palladians/supso:$(git rev-parse --short HEAD)