Skip to content

Commit

Permalink
add CI/CW for GHCR
Browse files Browse the repository at this point in the history
  • Loading branch information
egluckthaler committed Dec 18, 2023
1 parent 840f994 commit bd061eb
Showing 1 changed file with 34 additions and 0 deletions.
34 changes: 34 additions & 0 deletions .github/workflows/apptainer_build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
name: Build and Push Apptainer Image

on:
push:
branches:
- main # or any other branch you want to trigger the workflow

jobs:
build-and-push:
runs-on: ubuntu-latest
steps:
- name: Checkout Repository
uses: actions/checkout@v2

# Step to set up Apptainer and build the .sif image
- name: Build Apptainer Image
run: |
# Replace with commands to build your Apptainer image
sudo apt-get update
sudo apt-get install -y apptainer
apptainer build starfish.sif apptainer/starfish.def
# Step to log in to GitHub Packages
- name: Login to GitHub Container Registry
run: echo ${{ secrets.GITHUB_TOKEN }} | docker login ghcr.io -u ${{ github.actor }} --password-stdin

# Step to push the image to GitHub Packages
- name: Push to GitHub Packages
run: |
# Set the image tag
IMAGE_TAG=ghcr.io/${{ github.repository_owner }}/starfish:${{ github.sha }}
# Push the image
docker push $IMAGE_TAG

0 comments on commit bd061eb

Please sign in to comment.