Skip to content

Merge pull request #231 from gleanerio/dev_indentiifer_arks #96

Merge pull request #231 from gleanerio/dev_indentiifer_arks

Merge pull request #231 from gleanerio/dev_indentiifer_arks #96

Workflow file for this run

name: Dockerize Gleaner - Development Branch
on:
push:
branches:
- dev
release:
types: [published]
# https://github.com/marketplace/actions/publish-docker
# https://github.com/docker/build-push-action
jobs:
build:
name: Development Go Binary
runs-on: ubuntu-latest
strategy:
matrix:
# build and publish in parallel: linux/amd64
#goos: [linux, windows, darwin]
goarch: [amd64, arm64]
goos: [linux]
exclude:
- goarch: "386"
goos: darwin
steps:
- name: Install Go
uses: actions/setup-go@v2
- name: checkout code
uses: actions/checkout@v2
- name: donwload schema
run: curl https://schema.org/version/latest/schemaorg-current-https.jsonld --output assets/schemaorg-current-https.jsonld
- name: donwload schema
run: curl https://schema.org/version/latest/schemaorg-current-http.jsonld --output assets/schemaorg-current-http.jsonld
# - name: Run tests
# run: go test -v -p=1 -timeout=0 ./...
- id: binary
name: build
run: |
go build -o gleaner
working-directory: ./cmd/gleaner
env:
GOOS: ${{matrix.goss}}
GOARCH: ${{matrix.goarch}}
CGO_ENABLED: 0
# deploy:
# needs: build
# name: Dockerize Gleaner
# runs-on: ubuntu-latest
# steps:
# - name: Checkout Repo
# uses: actions/checkout@v2
- name: Set up QEMU
uses: docker/setup-qemu-action@v2
with:
platforms: 'arm64,arm'
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1
- name: Login to DockerHub
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Set variables
run: |
VER=$(cat ./VERSION)
echo "VERSION=$VER" >> $GITHUB_ENV
- name: Extract metadata (tags, labels) for Docker
id: meta
uses: docker/metadata-action@v3
with:
images: nsfearthcube/gleaner
flavor: |
latest=true
suffix=-${{ env.VERSION }}
tags: |
type=ref,event=tag
type=ref,event=branch
type=semver,pattern={{version}}
- name: Build and push
id: docker_build
uses: docker/build-push-action@v3
with:
push: true
platforms: linux/amd64,linux/arm64
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
file: ./build/Dockerfile
context: .
- name: Image digest
run: echo ${{ steps.docker_build.outputs.digest }}