Skip to content

RESTful API for authentication (#12) #160

RESTful API for authentication (#12)

RESTful API for authentication (#12) #160

Workflow file for this run

name: Go
on:
- push
- pull_request
concurrency:
cancel-in-progress: true
group: ${{ github.workflow }}-${{ github.ref }}-${{ github.event_name }}
jobs:
build:
name: Build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Setup Go
uses: actions/setup-go@v5
with:
go-version: stable
check-latest: true
id: go
- name: Get dependencies
run: |
go get -v -t -d ./...
if [ -f Gopkg.toml ]; then
curl https://raw.githubusercontent.com/golang/dep/master/install.sh | sh
dep ensure
fi
- name: Build
run: make
env:
CGO_ENABLED: 0
- name: Test
run: |
sudo chmod -R a+r /etc/ssh/sshd_config.d
make test
env:
CGO_ENABLED: 0
- uses: goreleaser/goreleaser-action@v6
if: startsWith(github.ref, 'refs/tags/')
with:
version: latest
args: release --clean
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Add additional GitHub Release assets
if: startsWith(github.ref, 'refs/tags/')
id: upload-release-asset
uses: softprops/action-gh-release@v1
with:
files: |
etc/config.example.toml
etc/sshmux.service
docker:
name: Docker
if: startsWith(github.ref, 'refs/tags/')
runs-on: ubuntu-latest
steps:
- name: Compute Docker metadata
id: meta
uses: docker/metadata-action@v5
with:
images: |
ghcr.io/${{ github.repository_owner }}/sshmux
tags: |
type=ref,event=branch
type=ref,event=pr
type=semver,pattern={{version}}
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Login to GHCR
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ github.token }}
- name: Build and push image
uses: docker/build-push-action@v6
with:
push: ${{ startsWith(github.ref, 'refs/tags/') }}
platforms: linux/amd64,linux/arm64
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}