diff --git a/.github/workflows/demo.yml b/.github/workflows/demo.yml deleted file mode 100644 index 8a9c1ff..0000000 --- a/.github/workflows/demo.yml +++ /dev/null @@ -1,18 +0,0 @@ -name: GitHub Actions Demo -run-name: ${{ github.actor }} is testing out GitHub Actions 🚀 -on: [push] -jobs: - Explore-GitHub-Actions: - runs-on: ubuntu-latest - steps: - - run: echo "🎉 The job was automatically triggered by a ${{ github.event_name }} event." - - run: echo "🐧 This job is now running on a ${{ runner.os }} server hosted by GitHub!" - - run: echo "🔎 The name of your branch is ${{ github.ref }} and your repository is ${{ github.repository }}." - - name: Check out repository code - uses: actions/checkout@v3 - - run: echo "💡 The ${{ github.repository }} repository has been cloned to the runner." - - run: echo "🖥️ The workflow is now ready to test your code on the runner." - - name: List files in the repository - run: | - ls ${{ github.workspace }} - - run: echo "🍏 This job's status is ${{ job.status }}." \ No newline at end of file diff --git a/.github/workflows/docker-image-push.yml b/.github/workflows/docker-image-push.yml new file mode 100644 index 0000000..dd92420 --- /dev/null +++ b/.github/workflows/docker-image-push.yml @@ -0,0 +1,54 @@ +name: Publish Docker image + +# Building and pushing a new Docker image when: +# > commit to master branch: ghcr.io/genomicdatainfrastructure/starter-kit-beacon2-ri-api:master +# > tagging with 'v'-prefix: ghcr.io/genomicdatainfrastructure/starter-kit-beacon2-ri-api: +# > pull-request: ghcr.io/genomicdatainfrastructure/starter-kit-beacon2-ri-api:pr- + +on: + workflow_dispatch: + push: + branches: + - 'master' + tags: + - 'v*' + pull_request: + branches: + - 'master' + +jobs: + build-and-push-image: + name: Push Docker image to Docker Hub + runs-on: ubuntu-latest + + # Needs a permission to write to GitHub Packages: + permissions: + contents: read + packages: write + + steps: + - name: Check out the repo + uses: actions/checkout@v4 + + - name: Log in to the Container registry + uses: docker/login-action@v3 + with: + registry: ghcr.io + username: ${{ github.actor }} + password: ${{ secrets.GITHUB_TOKEN }} + + - name: Extract metadata (tags, labels) for Docker + id: meta + uses: docker/metadata-action@v5 + with: + images: ghcr.io/${{ github.repository }} + + - name: Build and push Docker image + uses: docker/build-push-action@v5 + with: + # Indicates that the Docker build context is the current directory. + # Otherwise, it would be a Git URL (doing a separate clean checkout). + context: . + push: true + tags: ${{ steps.meta.outputs.tags }} + labels: ${{ steps.meta.outputs.labels }} diff --git a/deploy/docker-compose.yml b/deploy/docker-compose.yml index 422d5ba..e938e6f 100644 --- a/deploy/docker-compose.yml +++ b/deploy/docker-compose.yml @@ -57,7 +57,7 @@ services: beacon: build: .. - image: egarchive/beacon:2.0 + image: ghcr.io/genomicdatainfrastructure/starter-kit-beacon2-ri-api:master hostname: beacon container_name: beacon volumes: @@ -83,7 +83,7 @@ services: ########################################### permissions: - image: egarchive/beacon:2.0 + image: ghcr.io/genomicdatainfrastructure/starter-kit-beacon2-ri-api:master hostname: beacon-permissions container_name: beacon-permissions volumes: @@ -99,4 +99,3 @@ services: #entrypoint: ['/bin/sleep','100000000'] working_dir: '/beacon' entrypoint: ['python','-m', 'permissions'] -