-
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.
* Oppgrader prettier, flytt config til package.json * Formater filer * Formateringsscript og prettier ignore * Formater resten av uformaterte filer * Legg til pre-commit hook for prettier
- Loading branch information
Showing
17 changed files
with
468 additions
and
276 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 |
---|---|---|
@@ -1,65 +1,64 @@ | ||
name: Bygg og deploy | ||
|
||
on: | ||
[ push ] | ||
on: [push] | ||
|
||
env: | ||
IMAGE: docker.pkg.github.com/${{ github.repository }}/vis-stilling:${{ github.sha }} | ||
IMAGE: docker.pkg.github.com/${{ github.repository }}/vis-stilling:${{ github.sha }} | ||
|
||
jobs: | ||
bygg-og-push-docker-image: | ||
name: Bygg applikasjon | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v1 | ||
- uses: actions/setup-node@v1 | ||
with: | ||
node-version: 10 | ||
- uses: actions/cache@v1 | ||
with: | ||
path: ~/.npm | ||
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }} | ||
restore-keys: | | ||
${{ runner.os }}-node- | ||
bygg-og-push-docker-image: | ||
name: Bygg applikasjon | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v1 | ||
- uses: actions/setup-node@v1 | ||
with: | ||
node-version: 10 | ||
- uses: actions/cache@v1 | ||
with: | ||
path: ~/.npm | ||
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }} | ||
restore-keys: | | ||
${{ runner.os }}-node- | ||
- name: Installer avhengigheter | ||
run: npm ci | ||
- name: Bygg applikasjon | ||
run: npm run build | ||
- name: Installer avhengigheter for server | ||
run: npm run server:install | ||
- name: Bygg server | ||
run: npm run server:build | ||
- name: Bygg og publiser Docker-image | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
run: | | ||
docker build --tag ${IMAGE} . | ||
echo ${GITHUB_TOKEN} | docker login docker.pkg.github.com -u ${GITHUB_REPOSITORY} --password-stdin | ||
docker push ${IMAGE} | ||
- name: Installer avhengigheter | ||
run: npm ci | ||
- name: Bygg applikasjon | ||
run: npm run build | ||
- name: Installer avhengigheter for server | ||
run: npm run server:install | ||
- name: Bygg server | ||
run: npm run server:build | ||
- name: Bygg og publiser Docker-image | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
run: | | ||
docker build --tag ${IMAGE} . | ||
echo ${GITHUB_TOKEN} | docker login docker.pkg.github.com -u ${GITHUB_REPOSITORY} --password-stdin | ||
docker push ${IMAGE} | ||
deploy-til-dev: | ||
name: Deploy til dev | ||
needs: bygg-og-push-docker-image | ||
if: github.ref == 'refs/heads/master' || github.ref == 'refs/heads/rename-rekrutteringsbistand-api' | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v1 | ||
- uses: nais/deploy/actions/deploy@v1 | ||
env: | ||
APIKEY: ${{ secrets.NAIS_DEPLOY_APIKEY }} | ||
CLUSTER: dev-gcp | ||
RESOURCE: nais-dev.yaml | ||
deploy-til-dev: | ||
name: Deploy til dev | ||
needs: bygg-og-push-docker-image | ||
if: github.ref == 'refs/heads/master' || github.ref == 'refs/heads/rename-rekrutteringsbistand-api' | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v1 | ||
- uses: nais/deploy/actions/deploy@v1 | ||
env: | ||
APIKEY: ${{ secrets.NAIS_DEPLOY_APIKEY }} | ||
CLUSTER: dev-gcp | ||
RESOURCE: nais-dev.yaml | ||
|
||
deploy-to-prod: | ||
name: Deploy til prod | ||
needs: deploy-til-dev | ||
if: github.ref == 'refs/heads/master' | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v1 | ||
- uses: nais/deploy/actions/deploy@v1 | ||
env: | ||
APIKEY: ${{ secrets.NAIS_DEPLOY_APIKEY }} | ||
CLUSTER: prod-gcp | ||
RESOURCE: nais-prod.yaml | ||
deploy-to-prod: | ||
name: Deploy til prod | ||
needs: deploy-til-dev | ||
if: github.ref == 'refs/heads/master' | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v1 | ||
- uses: nais/deploy/actions/deploy@v1 | ||
env: | ||
APIKEY: ${{ secrets.NAIS_DEPLOY_APIKEY }} | ||
CLUSTER: prod-gcp | ||
RESOURCE: nais-prod.yaml |
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,4 @@ | ||
#!/bin/sh | ||
. "$(dirname "$0")/_/husky.sh" | ||
|
||
npx pretty-quick --staged |
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,3 @@ | ||
*.md | ||
build | ||
package-lock.json |
This file was deleted.
Oops, something went wrong.
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 |
---|---|---|
|
@@ -6,6 +6,7 @@ metadata: | |
labels: | ||
team: arbeidsgiver | ||
spec: | ||
# prettier-ignore | ||
image: {{ image }} | ||
port: 3000 | ||
ingresses: | ||
|
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 |
---|---|---|
|
@@ -6,6 +6,7 @@ metadata: | |
labels: | ||
team: arbeidsgiver | ||
spec: | ||
# prettier-ignore | ||
image: {{ image }} | ||
port: 3000 | ||
ingresses: | ||
|
Oops, something went wrong.