Skip to content

Commit

Permalink
Switch to GitHub Actions (#14)
Browse files Browse the repository at this point in the history
  • Loading branch information
JohnStarich authored Aug 1, 2021
1 parent 620d08a commit b45ee14
Show file tree
Hide file tree
Showing 4 changed files with 55 additions and 39 deletions.
25 changes: 25 additions & 0 deletions .github/workflows/cd.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
name: CD

on:
push:
branches: [ master ]

jobs:
deploy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Build
run: docker build -t go-wasm .
- name: Publish
run: |
git config --global user.email ""
git config --global user.name "GitHub Pages Deploy"
git checkout --orphan gh-pages
git rm -rf .
out=$(mktemp -d)
docker cp $(docker create --rm go-wasm):/usr/share/nginx/html "$out"
find "$out/html" -mindepth 1 -maxdepth 1 -exec cp -r {} ./ \; # Glob doesn't always pick up hidden files by default
git add .
git commit -am "Deploy to GitHub Pages"
git push --force origin gh-pages
27 changes: 27 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
name: CI

on:
push:
branches: [ master ]
pull_request:

jobs:
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-go@v2
with:
go-version: 1.16
- name: Lint
run: make lint

test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-go@v2
with:
go-version: 1.16
- name: Test
run: make test
33 changes: 0 additions & 33 deletions .travis.yml

This file was deleted.

9 changes: 3 additions & 6 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,10 +1,7 @@
FROM node:14-alpine as builder
FROM node:14 as builder

RUN apk add --no-cache \
bash \
git \
go \
make
RUN apt-get update && \
apt-get install -y golang

WORKDIR /src
# Cache go installation first
Expand Down

0 comments on commit b45ee14

Please sign in to comment.