Skip to content

Commit

Permalink
Merge pull request #135 from ecadlabs/ci_fix
Browse files Browse the repository at this point in the history
chore: ci fixes
  • Loading branch information
jevonearth authored Jul 1, 2021
2 parents b20a046 + b782302 commit 1905caf
Show file tree
Hide file tree
Showing 5 changed files with 77 additions and 51 deletions.
30 changes: 16 additions & 14 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ jobs:
steps:
- uses: actions/setup-go@v1
with:
go-version: 1.13
go-version: 1.16
- uses: actions/checkout@v2
- name: Setup Code Climate test-reporter
run: |
Expand Down Expand Up @@ -46,31 +46,33 @@ jobs:
runs-on: ubuntu-latest
needs: test
steps:
-
-
name: Checkout
uses: actions/checkout@v2
with:
fetch-depth: 0
-
name: Set up Go
-
name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1
-
name: Set up Go
uses: actions/setup-go@v2
with:
go-version: 1.16
go-version: '1.16'
-
name: Cache Go modules
uses: actions/cache@v2
with:
path: ~/go/pkg/mod
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
restore-keys: |
${{ runner.os }}-go-
-
name: Docker Login
if: startsWith(github.ref, 'refs/tags/v')
env:
DOCKER_USERNAME: ${{ secrets.DOCKER_USERNAME }}
DOCKER_PASSWORD: ${{ secrets.DOCKER_PASSWORD }}
run: echo "${DOCKER_PASSWORD}" | docker login --username "${DOCKER_USERNAME}" --password-stdin
-
name: Login to GitHub Container Registry
if: startsWith(github.ref, 'refs/tags/v')
uses: docker/login-action@v1
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}
-
name: Run GoReleaser
uses: goreleaser/goreleaser-action@v2
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/codeql-analysis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@ name: "CodeQL"

on:
push:
branches: [main]
branches: [master]
pull_request:
# The branches below must be a subset of the branches above
branches: [main]
branches: [master]
schedule:
- cron: '0 4 * * 5'

Expand Down
37 changes: 37 additions & 0 deletions .github/workflows/publish_website.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
name: Publish signatory.io website
on:
push:
branches:
- master

jobs:
publish-docs:
runs-on: ubuntu-latest
defaults:
run:
working-directory: website
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v1
with:
node-version: 12.x
- uses: actions/cache@v1
with:
path: ~/.npm
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-node-
- name: install npm deps
run: npm ci
- name: Publish to Github pages
env:
GITHUB_TOKEN: ${{ secrets.DEPLOY_GITHUB_TOKEN }}
GITHUB_EMAIL: ${{ secrets.DEPLOY_GITHUB_EMAIL }}
GIT_USER: ${{ secrets.DEPLOY_GITHUB_USER }}
CURRENT_BRANCH: $GITHUB_REF
run: |
git config --global user.email "$GITHUB_EMAIL"
git config --global user.name "$GITHUB_ACTOR"
echo "machine github.com login $GIT_USER password $GITHUB_TOKEN" > ~/.netrc
cat ~/.netrc
GIT_USER=${GIT_USER} npm run deploy
55 changes: 21 additions & 34 deletions .goreleaser.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
before:
hooks:
- go mod download
builds:
- id: signatory
binary: signatory
Expand All @@ -10,13 +11,18 @@ builds:
- '-X github.com/ecadlabs/signatory/pkg/metrics.GitRevision={{.Version}}'
- '-X github.com/ecadlabs/signatory/pkg/metrics.GitBranch={{.Version}}'
goos:
- freebsd
- linux
- windows
- darwin
goarch:
- amd64
- arm
- arm64
ignore:
- goos: darwin
goarch: 386
- goos: windows
goarch: 386
- id: signatory-cli
binary: signatory-cli
env:
Expand All @@ -26,50 +32,32 @@ builds:
- '-X github.com/ecadlabs/signatory/pkg/metrics.GitRevision={{.Version}}'
- '-X github.com/ecadlabs/signatory/pkg/metrics.GitBranch={{.Version}}'
goos:
- freebsd
- linux
- windows
- darwin
goarch:
- amd64
- arm
- arm64
ignore:
- goos: darwin
goarch: 386
- goos: windows
goarch: 386
dockers:
- ids:
- binaries:
- signatory
- signatory-cli
- image_templates:
- 'ecadlabs/signatory:{{ .Tag }}-amd64'
- 'ecadlabs/signatory:latest-amd64'
- 'ghcr.io/ecadlabs/signatory:{{ .Tag }}-amd64'
- 'ghcr.io/ecadlabs/signatory:latest-amd64'
dockerfile: Dockerfile
use: buildx
build_flag_templates:
- "--pull"
- "--label=org.opencontainers.image.created={{.Date}}"
- "--label=org.opencontainers.image.name={{.ProjectName}}"
- "--label=org.opencontainers.image.revision={{.FullCommit}}"
- "--label=org.opencontainers.image.version={{.Version}}"
- "--label=org.opencontainers.image.source={{.GitURL}}"
- "--platform=linux/amd64"
- image_templates:
- 'ecadlabs/signatory:{{ .Tag }}-arm64'
- 'ecadlabs/signatory:latest-arm64'
- 'ghcr.io/ecadlabs/signatory:{{ .Tag }}-arm64'
- 'ghcr.io/ecadlabs/signatory:latest-arm64'
builds:
- signatory
- signatory-cli
image_templates:
- 'ecadlabs/signatory:latest'
- 'ecadlabs/signatory:{{ .Tag }}'
dockerfile: Dockerfile
use: buildx
build_flag_templates:
- "--pull"
- "--label=org.opencontainers.image.created={{.Date}}"
- "--label=org.opencontainers.image.name={{.ProjectName}}"
- "--label=org.opencontainers.image.revision={{.FullCommit}}"
- "--label=org.opencontainers.image.version={{.Version}}"
- "--label=org.opencontainers.image.source={{.GitURL}}"
- "--platform=linux/arm64"
goarch: arm64
archives:
- replacements:
'386': i386
darwin: Darwin
linux: Linux
windows: Windows
Expand All @@ -83,5 +71,4 @@ changelog:
filters:
exclude:
- '^docs:'
- '^website:'
- '^test:'
2 changes: 1 addition & 1 deletion website/docusaurus.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ module.exports = {
path: '../docs',
sidebarPath: require.resolve('./sidebars.js'),
editUrl:
'https://github.com/ecadlabs/signatory/edit/main/website/',
'https://github.com/ecadlabs/signatory/edit/master/website/',
},
theme: {
customCss: require.resolve('./src/css/custom.css'),
Expand Down

0 comments on commit 1905caf

Please sign in to comment.