Skip to content

update dockerfiles #169

update dockerfiles

update dockerfiles #169

Workflow file for this run

name: build and test
on:
push:
paths-ignore:
- '**/README.md'
- '**/README_DEV.md'
jobs:
build-and-test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: browser-actions/setup-chrome@latest
- uses: actions/setup-go@v3
with:
go-version: '>=1.18.0'
# - name: Install dependencies
# run: go get -u golang.org/x/lint/golint
# - name: Run vet and lint
# run: |
# go vet .
# golint -set_exit_status=1 .
- run: go build
#- run: go test -timeout 120s ./...
- run: go test -race -coverprofile=coverage.out -covermode=atomic -timeout 120s ./...
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v3
publish-container:
runs-on: ubuntu-latest
needs: build-and-test
if: github.ref == 'refs/heads/main'
strategy:
matrix:
variant: [{dockerfile: Dockerfile, tagSuffix: ''}, {dockerfile: Dockerfile.unprivileged, tagSuffix: '-unprivileged'}, {dockerfile: Dockerfile.withoutPlayground, tagSuffix: '-without-playground'}]
steps:
- name: Set version to env
run: |
echo "VERSION=$(date +'%Y.%-m.%-d.%-H%M')" >> $GITHUB_ENV
- uses: actions/checkout@v3
with:
submodules: recursive
# - run: git submodule update --init
- name: Login to DockerHub
uses: docker/login-action@v1
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Login to Github Packages
uses: docker/login-action@v1
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Build and push docker image
uses: docker/build-push-action@v2
with:
platforms: linux/amd64, linux/arm64
file: ./${{ matrix.variant.dockerfile }}
context: ./
tags: |
lucasgaitzsch/pdf-turtle:latest${{ matrix.variant.tagSuffix }}
lucasgaitzsch/pdf-turtle:v${{ env.VERSION }}${{ matrix.variant.tagSuffix }}
ghcr.io/${{ github.repository }}:latest${{ matrix.variant.tagSuffix }}
ghcr.io/${{ github.repository }}:v${{ env.VERSION }}${{ matrix.variant.tagSuffix }}
push: true
- name: Docker Hub Description
uses: peter-evans/dockerhub-description@v3
env:
DOCKERHUB_USERNAME: ${{ secrets.DOCKERHUB_USERNAME }}
DOCKERHUB_PASSWORD: ${{ secrets.DOCKERHUB_PASSWORD }}
DOCKERHUB_REPOSITORY: lucasgaitzsch/pdf-turtle
short-description: ${{ github.event.repository.description }}