Skip to content

Commit

Permalink
Merge pull request #2 from oliviawarner/docker-workflow
Browse files Browse the repository at this point in the history
Docker Workflow
  • Loading branch information
github-learning-lab[bot] committed Jul 8, 2021
2 parents 4a3460c + 1abced6 commit 05b910f
Show file tree
Hide file tree
Showing 2 changed files with 67 additions and 46 deletions.
67 changes: 67 additions & 0 deletions .github/workflows/cd-workflow.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
name: Docker CD

on:
push:
paths:
- "**Dockerfile**"

jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- name: npm install and build webpack
run: |
npm install
npm run build
- uses: actions/upload-artifact@main
with:
name: webpack artifacts
path: public/

test:
runs-on: ubuntu-latest
needs: build
strategy:
matrix:
os: [ubuntu-lastest, windows-2016]
node-version: [12.x, 14.x]

steps:
- uses: actions/checkout@v1
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v1
with:
node-version: ${{ matrix.node-version }}
- uses: actions/download-artifact@main
with:
name: webpack artifacts
path: public
- name: npm install, and test
run: |
npm install
npm test
env:
CI: true

Build-and-Push-Docker-Image:
runs-on: ubuntu-latest
needs: test
name: Docker Build, Tag, Push

steps:
- name: Checkout
uses: actions/checkout@v1
- name: Download built artifact
uses: actions/download-artifact@main
with:
name: webpack artifacts
path: public
- name: Build container image
uses: docker/build-push-action@v1
with:
username: ${{github.actor}}
password: ${{secrets.GITHUB_TOKEN}}
registry: docker.pkg.github.com
repository: oliviawarner/github-actions-for-packages/tic-tac-toe
tag_with_sha: true
46 changes: 0 additions & 46 deletions .github/workflows/ci-workflow.yml

This file was deleted.

0 comments on commit 05b910f

Please sign in to comment.