File: docker.yml

package info (click to toggle)
genomicsdb 1.5.5-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 25,316 kB
  • sloc: cpp: 68,637; ansic: 58,281; java: 8,230; python: 2,315; sh: 2,115; perl: 1,621; makefile: 499; xml: 496
file content (67 lines) | stat: -rw-r--r-- 1,740 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
# from: https://docs.github.com/en/actions/publishing-packages/publishing-docker-images

name: Create and publish a Docker image

on:
  push:
    paths-ignore:
      - '**/*.md'
      - '**/*.rst'
    branches:
      - develop
    tags:
      - v*
  pull_request:
    paths-ignore:
      - '**/*.md'
      - '**/*.rst'

env:
  REGISTRY: ghcr.io
  IMAGE_NAME: ${{ github.repository }}

jobs:
  build-and-push-image:
    runs-on: ubuntu-latest
    permissions:
      contents: read
      packages: write

    steps:
      - name: Checkout repository
        uses: actions/checkout@v4

      - name: Log in to the Container registry
        uses: docker/login-action@v3
        with:
          registry: ${{ env.REGISTRY }}
          username: ${{ github.actor }}
          password: ${{ secrets.GITHUB_TOKEN }}

      - name: Extract metadata (tags, labels) for Docker
        id: meta
        uses: docker/metadata-action@v5
        with:
          images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}

      - name: Build and export to Docker
        uses: docker/build-push-action@v6
        with:
          context: .
          build-args: os=ubuntu:jammy
          load: true
          tags: ghcr.io/genomicsdb/genomicsdb:test

      - name: Test docker image
        run: |
          docker run --rm -v ${{github.workspace}}/tests:/opt/tests --entrypoint /opt/tests/docker_test.sh ghcr.io/genomicsdb/genomicsdb:test

      - name: Build and push to ghcr.io
        if: github.event_name != 'pull_request'
        uses: docker/build-push-action@v6
        with:
          context: .
          build-args: os=ubuntu:jammy
          push: true
          tags: ${{ steps.meta.outputs.tags }}
          labels: ${{ steps.meta.outputs.labels }}