-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Replace GitLab CI with GitHub Actions (#11)
Replace GitLab CI with GitHub Actions
- Loading branch information
1 parent
1fabbef
commit 9621d2f
Showing
4 changed files
with
83 additions
and
95 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
name: "Build and Publish" | ||
|
||
on: | ||
workflow_dispatch: | ||
push: | ||
tags: | ||
- "*" | ||
|
||
env: | ||
REGISTRY: ghcr.io | ||
IMAGE_NAMES: "beegfs-all\nbeegfs-mgmtd\nbeegfs-meta\nbeegfs-storage" | ||
|
||
jobs: | ||
publish-images: | ||
runs-on: ubuntu-22.04 | ||
timeout-minutes: 10 | ||
permissions: | ||
packages: write | ||
contents: read | ||
steps: | ||
- uses: actions/checkout@v3 | ||
|
||
- name: Set up Docker Buildx | ||
uses: docker/setup-buildx-action@v2 | ||
|
||
- name: Log in to the GitHub Container Registry | ||
uses: docker/login-action@v2 | ||
with: | ||
registry: ${{ env.REGISTRY }} | ||
username: ${{ github.actor }} | ||
password: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
- name: Install Cosign | ||
uses: sigstore/cosign-installer@v3.1.1 | ||
with: | ||
cosign-release: "v2.1.1" | ||
|
||
- name: Build, tag, sign, and push the container images to GitHub Container Registry | ||
run: | | ||
beegfs_version=$(git describe --tags --match '*.*' --abbrev=10) | ||
names=$(echo "${{ env.IMAGE_NAMES }}" | tr '\n' ' ') | ||
for name in $names; do | ||
image=ghcr.io/thinkparq/${name}:${beegfs_version} | ||
docker build -t $image --build-arg BEEGFS_VERSION=${beegfs_version} --target ${name} . | ||
docker push $image | ||
DIGEST=$(docker image inspect $image --format '{{index .RepoDigests 0}}') | ||
cosign sign --yes --key env://COSIGN_PRIVATE_KEY \ | ||
-a "repo=${{ github.repository }}" \ | ||
-a "run=${{ github.run_id }}" \ | ||
-a "ref=${{ github.sha }}" \ | ||
$DIGEST | ||
docker tag $image ghcr.io/thinkparq/${name}:latest | ||
docker push ghcr.io/thinkparq/${name}:latest | ||
done | ||
env: | ||
COSIGN_PRIVATE_KEY: ${{ secrets.COSIGN_PRIVATE_KEY }} | ||
COSIGN_PASSWORD: ${{ secrets.COSIGN_PASSWORD }} |
This file was deleted.
Oops, something went wrong.
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