Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fork pipeline #1

Open
wants to merge 11 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
124 changes: 61 additions & 63 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -1,76 +1,74 @@
name: ci

on:
push:
branches:
- "*" # run for branches
tags:
- "*" # run for tags
pull_request:
branches:
- "*" # run for branches
tags:
- "*" # run for tags
on: push

env:
GROUP: weaveworksdemos
COMMIT_SHA: ${{ github.sha }}
REPO: front-end

jobs:
test:
runs-on: ubuntu-latest
env:
GROUP: weaveworksdemos
COMMIT: ${{ github.sha }}
REPO: front-end
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v2

- uses: actions/setup-node@v1
with:
node-version: "4.x"

- run: npm install

#
#
# Set up node
- uses: actions/setup-node@v1
with:
node-version: '4.x'
- name: Test image
env:
DOCKER_BUILDKIT: 1
run: make test

#
#
# Install dependencies
- run: npm install
docker:
needs:
- test
runs-on: ubuntu-latest
env:
PUSH_DOCKER_IMAGE: true
DOCKER_NAME: ghcr.io/${{ github.repository }}
DOCKER_REGISTRY: ghcr.io
steps:
- uses: actions/checkout@v2

#
#
# Run node tests in docker image
- name: Test image
env:
DOCKER_BUILDKIT: 1
run: make test
- name: Build docker image
uses: docker/build-push-action@v1
with:
push: false
repository: ${{ env.GROUP }}/${{ env.REPO }}
tag_with_ref: true
tag_with_sha: true
tags: ${{ github.sha }}

#
#
# Build docker image for service
- name: Build docker image
uses: docker/build-push-action@v1
with:
push: false
repository: ${{ env.GROUP }}/${{ env.REPO }}
tag_with_ref: true
tag_with_sha: true
tags: ${{ github.sha }}
# - name: Test docker image
# env:
# DOCKER_BUILDKIT: 1
# run: ./test/container.sh

#
#
# Run simple test against built container
- name: Test docker image
env:
DOCKER_BUILDKIT: 1
run: ./test/container.sh
- name: Login to GHCR
uses: docker/login-action@v1
if: env.PUSH_DOCKER_IMAGE == 'true'
with:
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
registry: ${{ env.DOCKER_REGISTRY }}

#
#
# Push to dockerhub
- name: Push to Docker Hub
uses: docker/build-push-action@v1
if: startsWith(github.ref, 'refs/tags/v') || github.ref == 'refs/heads/master'
with:
username: ${{ secrets.DOCKER_USER }}
password: ${{ secrets.DOCKER_PASS }}
repository: ${{ env.GROUP }}/${{ env.REPO }}
tag_with_ref: true
tag_with_sha: true
- name: Push to ghcr.io
uses: docker/build-push-action@v2
# if: startsWith(github.ref, 'refs/tags/v') || github.ref == 'refs/heads/master'
with:
tags: ${{ env.DOCKER_NAME }}:${{ env.COMMIT_SHA }}
push: ${{ env.PUSH_DOCKER_IMAGE }}
# - name: Push to Docker Hub
# uses: docker/build-push-action@v1
# if: startsWith(github.ref, 'refs/tags/v') || github.ref == 'refs/heads/master'
# with:
# username: ${{ secrets.DOCKER_USER }}
# password: ${{ secrets.DOCKER_PASS }}
# repository: ${{ env.GROUP }}/${{ env.REPO }}
# tag_with_ref: true
# tag_with_sha: true
76 changes: 76 additions & 0 deletions .github/workflows/main.yml.orig
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
name: ci

on:
push:
branches:
- "*" # run for branches
tags:
- "*" # run for tags
pull_request:
branches:
- "*" # run for branches
tags:
- "*" # run for tags

jobs:
test:
runs-on: ubuntu-latest
env:
GROUP: weaveworksdemos
COMMIT: ${{ github.sha }}
REPO: front-end
steps:
- uses: actions/checkout@v2

#
#
# Set up node
- uses: actions/setup-node@v1
with:
node-version: '4.x'

#
#
# Install dependencies
- run: npm install

#
#
# Run node tests in docker image
- name: Test image
env:
DOCKER_BUILDKIT: 1
run: make test

#
#
# Build docker image for service
- name: Build docker image
uses: docker/build-push-action@v1
with:
push: false
repository: ${{ env.GROUP }}/${{ env.REPO }}
tag_with_ref: true
tag_with_sha: true
tags: ${{ github.sha }}

#
#
# Run simple test against built container
- name: Test docker image
env:
DOCKER_BUILDKIT: 1
run: ./test/container.sh

#
#
# Push to dockerhub
- name: Push to Docker Hub
uses: docker/build-push-action@v1
if: startsWith(github.ref, 'refs/tags/v') || github.ref == 'refs/heads/master'
with:
username: ${{ secrets.DOCKER_USER }}
password: ${{ secrets.DOCKER_PASS }}
repository: ${{ env.GROUP }}/${{ env.REPO }}
tag_with_ref: true
tag_with_sha: true
Loading