From 1fa14e12587bdb9d5fa048ecf1eaf97e26e49967 Mon Sep 17 00:00:00 2001 From: Geert van Geest Date: Wed, 10 Nov 2021 10:39:38 +0100 Subject: [PATCH] added ci for image --- .github/workflows/docker-image.yml | 48 +++++++++++++++++++++++ .github/workflows/push_to_gh_packages.yml | 42 -------------------- 2 files changed, 48 insertions(+), 42 deletions(-) create mode 100644 .github/workflows/docker-image.yml delete mode 100644 .github/workflows/push_to_gh_packages.yml diff --git a/.github/workflows/docker-image.yml b/.github/workflows/docker-image.yml new file mode 100644 index 0000000..6188d37 --- /dev/null +++ b/.github/workflows/docker-image.yml @@ -0,0 +1,48 @@ +name: build and push CI + +on: + workflow_dispatch: + push: + tags: + - 'v*.*' + +jobs: + docker: + runs-on: ubuntu-latest + steps: + - + name: Docker meta + id: meta + uses: docker/metadata-action@v3 + with: + # list of Docker images to use as base name for tags + images: | + geertvangeest/ngs-variants-jupyter + # generate Docker tags based on the following events/attributes + tags: | + type=semver,pattern={{major}}.{{minor}} + - + name: Checkout + uses: actions/checkout@v2 + - + name: Set up QEMU + uses: docker/setup-qemu-action@v1 + - + name: Set up Docker Buildx + uses: docker/setup-buildx-action@v1 + - + name: Login to DockerHub + uses: docker/login-action@v1 + with: + username: ${{ secrets.DOCKERHUB_USERNAME }} + password: ${{ secrets.DOCKERHUB_TOKEN }} + - + name: Build and push + id: docker_build + uses: docker/build-push-action@v2 + with: + push: true + context: ./Docker + tags: ${{ steps.meta.outputs.tags }} + labels: ${{ steps.meta.outputs.labels }} + diff --git a/.github/workflows/push_to_gh_packages.yml b/.github/workflows/push_to_gh_packages.yml deleted file mode 100644 index ea4bab7..0000000 --- a/.github/workflows/push_to_gh_packages.yml +++ /dev/null @@ -1,42 +0,0 @@ -name: Publish Docker image -on: - release: - types: [published] -jobs: - push_to_registry: - name: Push Docker image to GitHub Packages - runs-on: ubuntu-latest - steps: - - name: Check out the repo - uses: actions/checkout@v2 - - name: Push to GitHub Packages - uses: docker/build-push-action@v1 - with: - username: ${{ github.actor }} - password: ${{ secrets.GITHUB_TOKEN }} - registry: docker.pkg.github.com - path: Docker - repository: sib-swiss/ngs-variants-training/ngs-variants-jupyter - tag_with_ref: true - - -# name: Publish Docker image -# on: -# release: -# types: [published] -# jobs: -# push_to_registry: -# name: Push Docker image to Docker Hub -# runs-on: ubuntu-latest -# steps: -# - name: Check out the repo -# uses: actions/checkout@v2 -# - name: Push to Docker Hub -# uses: docker/build-push-action@v1 -# with: -# username: ${{ secrets.DOCKER_USERNAME }} -# password: ${{ secrets.DOCKER_PASSWORD }} -# repository: geertvangeest/ngs-variants-jupyter -# path: Docker -# tags: latest -# tag_with_ref: true