Merge pull request #28 from msfidelis/feature/wolfi-image #34
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: 'chip ci' | |
on: | |
push: | |
jobs: | |
unit-test: | |
strategy: | |
matrix: | |
go-version: [1.22.x] | |
platform: [ubuntu-latest] | |
runs-on: ${{ matrix.platform }} | |
steps: | |
- uses: actions/setup-go@v1 | |
with: | |
go-version: ${{ matrix.go-version }} | |
- name: setup GOPATH into PATH | |
run: | | |
echo "::set-env name=GOPATH::$(go env GOPATH)" | |
echo "::add-path::$(go env GOPATH)/bin" | |
shell: bash | |
env: | |
ACTIONS_ALLOW_UNSECURE_COMMANDS: true | |
- uses: actions/checkout@v2 | |
- name: Install dependencies | |
run: go get -u | |
# - name: Run's Golint | |
# run: | | |
# export PATH=$PATH:$(go env GOPATH)/bin | |
# go get -u golang.org/x/lint/golint | |
# golint -set_exit_status ./... | |
# - name: Test | |
# run: go test -v | |
build-docker-artifacts: | |
needs: [ unit-test ] | |
runs-on: ubuntu-latest | |
if: contains(github.ref, 'main') | |
steps: | |
- uses: actions/setup-go@v1 | |
with: | |
go-version: '1.22.x' | |
- uses: actions/checkout@v1 | |
- name: Docker Build | |
run: docker build -t chip:latest . | |
- name: Docker Tag Latest | |
run: docker tag chip:latest fidelissauro/chip:latest | |
- name: Docker Tag V1 | |
run: docker tag chip:latest fidelissauro/chip:v1 | |
- name: Docker Tag V2 | |
run: docker tag chip:latest fidelissauro/chip:v2 | |
- name: Login to DockerHub | |
uses: docker/login-action@v1 | |
with: | |
username: ${{ secrets.DOCKER_USERNAME }} | |
password: ${{ secrets.DOCKER_PASSWORD}} | |
- name: Docker Push Latest | |
run: docker push fidelissauro/chip:latest | |
- name: Docker Push v1 | |
run: docker push fidelissauro/chip:v1 | |
- name: Docker Push v2 | |
run: docker push fidelissauro/chip:v2 |