Skip to content
This repository has been archived by the owner on Aug 8, 2024. It is now read-only.

Commit

Permalink
docker fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
tiero committed Jun 11, 2024
1 parent 6ec3cd7 commit 603cadc
Show file tree
Hide file tree
Showing 2 changed files with 40 additions and 19 deletions.
57 changes: 39 additions & 18 deletions .github/workflows/on-tag.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,28 @@ jobs:
- name: Checkout code
uses: actions/checkout@v2

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1

- name: Login to GitHub Container Registry
uses: docker/login-action@v1
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Extract tag name
id: extract_tag
run: echo "::set-output name=tag::${GITHUB_REF#refs/tags/}"

- name: Build and push Docker image
uses: docker/build-push-action@v2
with:
context: .
push: true
tags: ark-network/clark:latest,ark-network/clark:${{ steps.extract_tag.outputs.tag }}
platforms: linux/amd64,linux/arm64

- name: Install Rust toolchain
uses: actions-rs/toolchain@v1
with:
Expand All @@ -33,24 +55,6 @@ jobs:
cargo build --release --target aarch64-unknown-linux-gnu
cargo build --release --target aarch64-apple-darwin
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1

- name: Login to GitHub Container Registry
uses: docker/login-action@v1
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Build and push Docker image
uses: docker/build-push-action@v2
with:
context: .
push: true
tags: ark-network/clark:latest
platforms: linux/amd64,linux/arm64,darwin/amd64,darwin/arm64

- name: Create Release
id: create_release
uses: actions/create-release@v1
Expand All @@ -76,3 +80,20 @@ jobs:
"${{ steps.create_release.outputs.upload_url }}?name=$binary-$target"
done
done
- name: Update Release Description
uses: actions/github-script@v5
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
script: |
const { owner, repo } = context.repo
const releaseId = ${{ steps.create_release.outputs.id }}
const dockerImage = `ghcr.io/ark-network/clark`
const newBody = `Docker image available at \`${dockerImage}\`. You can pull it using \`docker pull ${dockerImage}\`.`
github.rest.repos.updateRelease({
owner,
repo,
release_id: releaseId,
body: newBody
})
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Stage 1: Building the code
FROM rust:1.78 as builder
FROM rust:bullseye as builder

WORKDIR /usr/src

Expand Down

0 comments on commit 603cadc

Please sign in to comment.