This repository has been archived by the owner on Aug 30, 2024. It is now read-only.
this shit is making me go brr #11
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Publish to GHCR | |
on: | |
push: | |
tags: | |
- 'v*' | |
permissions: | |
packages: write | |
env: | |
CARGO_TERM_COLOR: always | |
jobs: | |
publish: | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
architecture: [amd64, arm64] | |
include: | |
- architecture: amd64 | |
target: x86_64-unknown-linux-gnu | |
- architecture: arm64 | |
target: aarch64-unknown-linux-gnu | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Set up Rust | |
uses: actions-rs/toolchain@v1 | |
with: | |
toolchain: stable | |
override: true | |
- name: Install dependencies | |
run: sudo apt-get update && sudo apt-get install -y pkg-config libssl-dev | |
- name: Check architecture | |
id: arch-check | |
run: echo "Architecture is ${{ matrix.architecture }}" | |
- name: Build Docker image | |
if: ${{ matrix.architecture == 'amd64' }} | |
run: | | |
TAG=${{ github.ref_name }} | |
docker build --build-arg TARGET=${{ matrix.target }} -t ghcr.io/tkbstudios/netchat-server-rust/netchat-server:${TAG} -t ghcr.io/tkbstudios/netchat-server-rust/netchat-server:latest . | |
- name: Log in to GHCR | |
uses: docker/login-action@v2 | |
with: | |
registry: ghcr.io | |
username: ${{ github.actor }} | |
password: ${{ secrets.GITHUB_TOKEN }} | |
- name: Push Docker image | |
if: ${{ matrix.architecture == 'amd64' }} | |
run: | | |
TAG=${{ github.ref_name }} | |
docker push ghcr.io/tkbstudios/netchat-server-rust/netchat-server:${TAG} | |
docker push ghcr.io/tkbstudios/netchat-server-rust/netchat-server:latest | |
- name: Skip aarch64 build | |
if: ${{ matrix.architecture == 'arm64' }} | |
run: echo "Skipping build for aarch64" |