Skip to content

feat: use publiccode-parser-go v4 #424

feat: use publiccode-parser-go v4

feat: use publiccode-parser-go v4 #424

on:
push:
branches:
- main
pull_request:
name: ci
jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
# The build job will use the .git directory to
# infer the current version to embed in the binary
fetch-depth: 0
- uses: actions/setup-go@v5
with:
go-version: '1.21'
- run: go build
- run: go test -race ./...
build_and_publish_docker_image:
needs: test
runs-on: ubuntu-latest
if: ${{ github.event_name != 'pull_request' }}
steps:
- name: Login to DockerHub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Get Docker image tags
id: image_tags
run: |
IMAGE=italia/publiccode-crawler
TAGS=${IMAGE}:latest
TAGS="$TAGS,${IMAGE}:${GITHUB_SHA::8}"
echo ::set-output name=tags::${TAGS}
- name: Build and push
uses: docker/build-push-action@v5
with:
build-args: |
BUILDKIT_CONTEXT_KEEP_GIT_DIR=1
push: true
tags: ${{ steps.image_tags.outputs.tags }}