Skip to content

Commit 1649d1e

Browse files
committed
fix: test docker build
1 parent 56c9436 commit 1649d1e

File tree

3 files changed

+96
-4
lines changed

3 files changed

+96
-4
lines changed

.github/workflows/automated.yml

Lines changed: 82 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,82 @@
1+
name: Automated Deployment
2+
3+
on:
4+
push:
5+
branches:
6+
- master
7+
8+
jobs:
9+
about:
10+
runs-on: ubuntu-latest
11+
steps:
12+
- name: Checkout
13+
uses: actions/checkout@v2
14+
15+
- name: Jaid/action-sync-node-meta
16+
uses: jaid/action-sync-node-meta@v1.4.0
17+
with:
18+
direction: overwrite-github # default is overwrite-file
19+
githubToken: ${{ secrets.GITHUB }}
20+
21+
# docs:
22+
# runs-on: ubuntu-latest
23+
# steps:
24+
# - name: Checkout
25+
# uses: actions/checkout@v2
26+
27+
# - name: update documentation
28+
# uses: CoCreate-app/CoCreate-docs@master
29+
30+
release:
31+
runs-on: ubuntu-latest
32+
steps:
33+
- name: Checkout
34+
uses: actions/checkout@v2
35+
36+
- name: Semantic Release
37+
uses: cycjimmy/semantic-release-action@v2
38+
id: semantic
39+
with:
40+
# You can specify specifying version range for the extra plugins if you prefer.
41+
extra_plugins: |
42+
@semantic-release/changelog
43+
@semantic-release/npm
44+
@semantic-release/git
45+
@semantic-release/github
46+
env:
47+
GITHUB_TOKEN: ${{ secrets.GITHUB }}
48+
NPM_TOKEN: ${{ secrets.NPM_TOKEN }} # Auto Changog generator
49+
outputs:
50+
new_release_published: ${{ steps.semantic.outputs.new_release_published }}
51+
new_release_version: ${{ steps.semantic.outputs.new_release_version }}
52+
53+
package:
54+
runs-on: ubuntu-latest
55+
needs: release
56+
if: needs.release.outputs.new_release_published == 'true'
57+
env:
58+
IMAGE: docker.pkg.github.com/cocreate-app/cocreate-docs
59+
VERSION: ${{ needs.release.outputs.new_release_version }}
60+
steps:
61+
- name: Checkout repository
62+
uses: actions/checkout@v1
63+
64+
- name: npm login
65+
env:
66+
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
67+
run: >
68+
echo "//registry.npmjs.org/:_authToken=${{ secrets.NPM_TOKEN }}" >
69+
.npmrc
70+
- name: Login docker registry
71+
env:
72+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
73+
run: |
74+
docker login docker.pkg.github.com -u ${GITHUB_ACTOR} -p ${GITHUB_TOKEN}
75+
76+
- name: Build docker image
77+
run: docker build . -t ${IMAGE}:latest -t ${IMAGE}:${VERSION}
78+
79+
- name: Push docker image
80+
run: |
81+
docker push ${IMAGE}:latest
82+
docker push ${IMAGE}:${VERSION}

Dockerfile

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
FROM mhart/alpine-node:12
2+
3+
ENV NODE_ENV=production
4+
5+
WORKDIR /usr/src/app
6+
7+
COPY . /usr/src/app/
8+
RUN npm install
9+
10+
CMD [ "npm", "start" ]

action.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@ outputs:
88
success:
99
description: 'successful'
1010
runs:
11-
using: 'node12'
12-
main: './src/index.js'
13-
14-
11+
# using: 'node12'
12+
# main: './src/index.js'
13+
using: 'docker'
14+
image: 'docker.pkg.github.com/cocreate-app/cocreate-docs'
1515

0 commit comments

Comments
 (0)