-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #2 from StaleLoafOfBread/docker-workflow
Docker Workflow
- Loading branch information
Showing
2 changed files
with
67 additions
and
46 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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@v2 | ||
with: | ||
username: ${{github.actor}} | ||
password: ${{secrets.GITHUB_TOKEN}} | ||
registry: docker.pkg.github.com | ||
repository: StaleLoafOfBread/github-actions-for-packages/tic-tac-toe | ||
tag_with_sha: true |
This file was deleted.
Oops, something went wrong.