-
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 #13 from rarimo/devops/ci
migrate from werf to skaffold
- Loading branch information
Showing
5 changed files
with
50 additions
and
66 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 |
---|---|---|
|
@@ -2,6 +2,7 @@ on: | |
push: | ||
branches: | ||
- 'main' | ||
- 'devops/ci' | ||
|
||
jobs: | ||
converge: | ||
|
@@ -14,23 +15,25 @@ jobs: | |
with: | ||
fetch-depth: 0 | ||
|
||
- name: Install werf | ||
uses: werf/actions/[email protected] | ||
|
||
- name: Log in to registry | ||
# This is where you will update the personal access token to GITHUB_TOKEN | ||
run: echo "${{ secrets.GITHUB_TOKEN }}" | docker login ghcr.io -u $ --password-stdin | ||
|
||
- name: Run echo | ||
run: | | ||
werf version | ||
docker version | ||
echo $GITHUB_REPOSITORY | ||
echo $GITHUB_SHA | ||
- name: Run Build | ||
run: | | ||
. $(werf ci-env github --as-file) | ||
werf export web --tag ghcr.io/$GITHUB_REPOSITORY:$GITHUB_SHA | ||
echo "${{ secrets.GITHUB_TOKEN }}" | docker login ghcr.io -u $ --password-stdin | ||
- name: Cache layers | ||
uses: actions/cache@v3 | ||
with: | ||
path: "${{ github.workspace }}/.skaffold/cache" | ||
key: skaffold-${{ hashFiles('**/cache') }} | ||
restore-keys: | | ||
skaffold- | ||
- name: Run Skaffold pipeline as command | ||
uses: hiberbee/github-action-skaffold@latest | ||
id: build | ||
with: | ||
command: build --tag ${{ github.sha }} | ||
repository: ghcr.io/${{ github.repository_owner }} | ||
|
||
deploy: | ||
name: Deploy | ||
|
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 |
---|---|---|
|
@@ -15,23 +15,25 @@ jobs: | |
with: | ||
fetch-depth: 0 | ||
|
||
- name: Install werf | ||
uses: werf/actions/[email protected] | ||
|
||
- name: Log in to registry | ||
# This is where you will update the personal access token to GITHUB_TOKEN | ||
run: echo "${{ secrets.GITHUB_TOKEN }}" | docker login ghcr.io -u $ --password-stdin | ||
|
||
- name: Run echo | ||
run: | | ||
werf version | ||
docker version | ||
echo $GITHUB_REPOSITORY | ||
echo $GITHUB_REF_NAME | ||
- name: Run Build | ||
run: | | ||
. $(werf ci-env github --as-file) | ||
werf export web --tag ghcr.io/$GITHUB_REPOSITORY:$GITHUB_REF_NAME | ||
echo "${{ secrets.GITHUB_TOKEN }}" | docker login ghcr.io -u $ --password-stdin | ||
- name: Cache layers | ||
uses: actions/cache@v3 | ||
with: | ||
path: "${{ github.workspace }}/.skaffold/cache" | ||
key: skaffold-${{ hashFiles('**/cache') }} | ||
restore-keys: | | ||
skaffold- | ||
- name: Run Skaffold pipeline as command | ||
uses: hiberbee/github-action-skaffold@latest | ||
id: build | ||
with: | ||
command: build --tag ${{ github.ref_name }} | ||
repository: ghcr.io/${{ github.repository_owner }} | ||
|
||
deploy: | ||
name: Deploy | ||
|
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,12 @@ | ||
FROM node:18 as builder | ||
|
||
WORKDIR /app | ||
COPY package.json yarn.lock ./ | ||
RUN yarn install | ||
|
||
COPY . . | ||
RUN yarn build | ||
|
||
FROM nginx:stable-alpine | ||
COPY nginx.conf /etc/nginx/nginx.conf | ||
COPY --from=builder /app/dist /usr/share/nginx/html |
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,5 @@ | ||
apiVersion: skaffold/v2beta28 | ||
kind: Config | ||
build: | ||
artifacts: | ||
- image: landing-rarimo |