mirror of
https://github.com/ribbybibby/ssl_exporter.git
synced 2026-05-21 15:52:47 +00:00
CI improvements
This commit is contained in:
44
.github/workflows/build.yaml
vendored
44
.github/workflows/build.yaml
vendored
@@ -1,44 +0,0 @@
|
||||
name: build
|
||||
on: [push, pull_request]
|
||||
jobs:
|
||||
docker:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- name: Set up Docker Buildx
|
||||
uses: docker/setup-buildx-action@v1
|
||||
- name: Login to Docker Hub
|
||||
uses: docker/login-action@v1
|
||||
with:
|
||||
username: ${{ secrets.DOCKERHUB_USERNAME }}
|
||||
password: ${{ secrets.DOCKERHUB_TOKEN }}
|
||||
- name: Extract metadata (tags, labels) for Docker
|
||||
id: meta
|
||||
uses: docker/metadata-action@v3
|
||||
with:
|
||||
images: ribbybibby/ssl-exporter
|
||||
- name: Build and push Docker image
|
||||
uses: docker/build-push-action@v2
|
||||
with:
|
||||
context: .
|
||||
push: true
|
||||
tags: ${{ steps.meta.outputs.tags }}
|
||||
labels: ${{ steps.meta.outputs.labels }}
|
||||
snapshot:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v1
|
||||
- name: Set up Go
|
||||
uses: actions/setup-go@v1
|
||||
with:
|
||||
go-version: 1.17.x
|
||||
- name: Build release snapshot
|
||||
run: make snapshot
|
||||
- name: Archive release snapshot
|
||||
uses: actions/upload-artifact@v2
|
||||
with:
|
||||
name: release-snapshot
|
||||
path: |
|
||||
bin/*.tar.gz
|
||||
bin/*.txt
|
||||
bin/*.yaml
|
||||
9
.github/workflows/release.yaml
vendored
9
.github/workflows/release.yaml
vendored
@@ -10,12 +10,21 @@ jobs:
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v2
|
||||
|
||||
- name: Unshallow
|
||||
run: git fetch --prune --unshallow
|
||||
|
||||
- name: Set up Go
|
||||
uses: actions/setup-go@v1
|
||||
with:
|
||||
go-version: 1.17.x
|
||||
|
||||
- name: Login to Docker Hub
|
||||
uses: docker/login-action@v1
|
||||
with:
|
||||
username: ${{ secrets.DOCKERHUB_USERNAME }}
|
||||
password: ${{ secrets.DOCKERHUB_TOKEN }}
|
||||
|
||||
- name: Release with GoReleaser
|
||||
run: make release
|
||||
env:
|
||||
|
||||
39
.github/workflows/test-and-snapshot.yaml
vendored
Normal file
39
.github/workflows/test-and-snapshot.yaml
vendored
Normal file
@@ -0,0 +1,39 @@
|
||||
name: test-and-snapshot
|
||||
|
||||
on: [push, pull_request]
|
||||
|
||||
jobs:
|
||||
test:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
|
||||
- name: Set up Go
|
||||
uses: actions/setup-go@v1
|
||||
with:
|
||||
go-version: 1.17.x
|
||||
|
||||
- name: Test
|
||||
run: make test
|
||||
|
||||
snapshot:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v1
|
||||
|
||||
- name: Set up Go
|
||||
uses: actions/setup-go@v1
|
||||
with:
|
||||
go-version: 1.17.x
|
||||
|
||||
- name: Build release snapshot
|
||||
run: make snapshot
|
||||
|
||||
- name: Archive release snapshot
|
||||
uses: actions/upload-artifact@v2
|
||||
with:
|
||||
name: release-snapshot
|
||||
path: |
|
||||
bin/*.tar.gz
|
||||
bin/*.txt
|
||||
bin/*.yaml
|
||||
Reference in New Issue
Block a user