-
Notifications
You must be signed in to change notification settings - Fork 1
45 lines (36 loc) · 1.23 KB
/
release-docker.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
38
39
40
41
42
43
44
45
name: Release Docker
on:
push:
branches:
- main
workflow_dispatch:
env:
CARGO_TERM_COLOR: always
IMAGE_NAME: ghcr.io/${{ github.repository_owner }}/xs
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
# Install Rust and cross-compile the binary in release mode
- name: Set up Rust
uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: stable
- name: Build in release mode
run: cargo build --release --verbose
- name: Install scru128-cli from GitHub
run: |
cargo install --git https://github.com/cablehead/scru128-cli --branch main
mv ~/.cargo/bin/scru128 target/release/scru128
# Create a Docker image, using the Dockerfile from the .github/workflows directory
- name: Build Docker image
run: |
docker build -t $IMAGE_NAME:latest -f .github/workflows/Dockerfile.release-docker .
# Log in to the GitHub Container Registry (GHCR)
- name: Log in to GitHub Container Registry
run: echo "${{ secrets.GHCR_PAT }}" | docker login ghcr.io -u ${{ github.actor }} --password-stdin
# Push the Docker image to GHCR
- name: Push Docker image
run: docker push $IMAGE_NAME:latest