Skip to content

Commit

Permalink
Merge pull request #13 from rarimo/devops/ci
Browse files Browse the repository at this point in the history
migrate from werf to skaffold
  • Loading branch information
ardier16 authored Nov 21, 2024
2 parents 46bc8be + 922dd00 commit 954c865
Show file tree
Hide file tree
Showing 5 changed files with 50 additions and 66 deletions.
31 changes: 17 additions & 14 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ on:
push:
branches:
- 'main'
- 'devops/ci'

jobs:
converge:
Expand All @@ -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
Expand Down
30 changes: 16 additions & 14 deletions .github/workflows/tag.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
12 changes: 12 additions & 0 deletions Dockerfile
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
5 changes: 5 additions & 0 deletions skaffold.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
apiVersion: skaffold/v2beta28
kind: Config
build:
artifacts:
- image: landing-rarimo
38 changes: 0 additions & 38 deletions werf.yaml

This file was deleted.

0 comments on commit 954c865

Please sign in to comment.