1
1
Fork 0
mirror of https://github.com/joshdk/drone-skip-pipeline synced 2024-05-07 19:06:02 +02:00
drone-skip-pipeline/.github/workflows/main.yml
2021-11-14 18:27:59 -08:00

54 lines
1.2 KiB
YAML

name: Build
on: [pull_request]
jobs:
lint:
name: Lint
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Run commitlint
uses: wagoid/commitlint-github-action@v4
- name: Run golangci-lint
uses: golangci/golangci-lint-action@v2
with:
version: v1.42.0
docker:
name: Docker
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Docker login
uses: docker/login-action@v1
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Docker build and push
run: |
image_name=ghcr.io/joshdk/drone-skip-pipeline
image_label="pr$(echo "$GITHUB_REF" | cut -d/ -f3)"
docker build \
--build-arg CREATED="$(date -u +'%Y-%m-%dT%H:%M:%SZ')" \
--build-arg REVISION="$(git rev-parse HEAD)" \
--build-arg VERSION="$image_label" \
--tag "$image_name:$image_label" \
.
docker push "$image_name:$image_label"