Unverified Commit 9197ad7b authored by Gary van Woerkens's avatar Gary van Woerkens Committed by GitHub
Browse files

fix: Use autodevops actions. (#224)


Co-authored-by: default avatarsemantic-release-bot <semantic-release-bot@martynus.net>
parent 2aadb9ed
SOCIALGOUV_BASE_DOMAIN=dev.fabrique.social.gouv.fr
RANCHER_PROJECT_ID=c-gjtkk:p-svtfv
SOCIALGOUV_BASE_DOMAIN=dev.fabrique.social.gouv.fr
RANCHER_PROJECT_ID=c-gjtkk:p-svtfv
SOCIALGOUV_BASE_DOMAIN=fabrique.social.gouv.fr
RANCHER_PROJECT_ID=c-5rj5b:p-jx8kp
{
"enabled": true,
"extends": ["github>SocialGouv/renovate-config:light"]
}
name: Deactivate
on:
pull_request:
types: [ closed ]
jobs:
bury_review_env:
name: 🪦 Review
runs-on: ubuntu-latest
steps:
- uses: SocialGouv/actions/k8s-funeral@master
with:
kube-config: ${{ secrets.SOCIALGOUV_KUBE_CONFIG_DEV }}
name: Production
on:
push:
tags:
- v*
concurrency:
group: preproduction
cancel-in-progress: true
jobs:
##############################################################################
## BUILD AND REGISTER DOCKER IMAGE
##############################################################################
register:
name: Build & Register application
runs-on: ubuntu-latest
steps:
- name: Get project name
run: |
echo "project=${GITHUB_REPOSITORY#*/}" >> $GITHUB_ENV
- name: Use autodevops build and register
uses: SocialGouv/actions/autodevops-build-register@master
with:
project: ${{ env.project }}
token: ${{ secrets.GITHUB_TOKEN }}
imageName: archifiltre/${{ env.project }}
##############################################################################
## GENERATE PREPRODUCTION MANIFESTS
##############################################################################
manifests:
name: Preproduction manifests
runs-on: ubuntu-latest
steps:
- name: Use autodevops manifests generation
uses: SocialGouv/actions/autodevops-manifests@master
with:
environment: "preprod"
##############################################################################
## DEPLOY PREPRODUCTION APPLICATION
##############################################################################
deploy-preprod:
name: Deploy application
runs-on: ubuntu-latest
needs: [register, manifests]
environment:
name: preproduction
url: https://${{ env.ns }}.${{ env.SOCIALGOUV_BASE_DOMAIN }}
steps:
- name: Checkout repository
uses: actions/checkout@v2
- name: Get project and namespace names
run: |
cat ".github/preprod.env" >> $GITHUB_ENV
echo "project=${GITHUB_REPOSITORY#*/}" >> $GITHUB_ENV
echo "ns=${GITHUB_REPOSITORY#*/}-${GITHUB_REF##*/}" >> $GITHUB_ENV
- name: Use autodevops deployment
uses: SocialGouv/actions/autodevops-deploy@master
with:
environment: "preprod"
token: ${{ secrets.GITHUB_TOKEN }}
kubeconfig: ${{ secrets.SOCIALGOUV_KUBE_CONFIG_DEV }}
##############################################################################
## GENERATE PRODUCTION MANIFESTS
##############################################################################
manifests-prod:
name: Production manifests
runs-on: ubuntu-latest
steps:
- name: Use autodevops manifests generation
uses: SocialGouv/actions/autodevops-manifests@master
with:
environment: "prod"
##############################################################################
## DEPLOY PRODUCTION APPLICATION
##############################################################################
deploy-prod:
name: Deploy application
runs-on: ubuntu-latest
needs: [deploy-preprod, manifests-prod]
environment:
name: production
url: https://${{ env.ns }}.${{ env.SOCIALGOUV_BASE_DOMAIN }}
steps:
- name: Checkout repository
uses: actions/checkout@v2
- name: Get project and namespace names
run: |
cat ".github/prod.env" >> $GITHUB_ENV
echo "project=${GITHUB_REPOSITORY#*/}" >> $GITHUB_ENV
echo "ns=${GITHUB_REPOSITORY#*/}-${GITHUB_REF##*/}" >> $GITHUB_ENV
- name: Use autodevops deployment
uses: SocialGouv/actions/autodevops-deploy@master
with:
environment: "prod"
token: ${{ secrets.GITHUB_TOKEN }}
kubeconfig: ${{ secrets.SOCIALGOUV_KUBE_CONFIG_PROD }}
name: Release
on:
workflow_dispatch:
push:
branches: [master, alpha, beta, next]
jobs:
release:
name: Release
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v2
with:
fetch-depth: 0
persist-credentials: false
- name: Semantic Release
uses: cycjimmy/semantic-release-action@v2
with:
semantic_version: 17
extra_plugins: |
@semantic-release/changelog@5.0.1
@semantic-release/git@9.0.0
env:
GITHUB_TOKEN: ${{ secrets.SOCIALGROOVYBOT_BOTO_PAT }}
name: Review
on:
push:
branches:
- '**'
tags-ignore:
- v*
concurrency:
cancel-in-progress: true
group: ${{ github.ref }}
jobs:
##############################################################################
## BUILD AND REGISTER DOCKER IMAGES
##############################################################################
register:
name: Build & Register application
runs-on: ubuntu-latest
steps:
- name: Get project name
run: |
echo "project=${GITHUB_REPOSITORY#*/}" >> $GITHUB_ENV
- name: Use autodevops build and register
uses: SocialGouv/actions/autodevops-build-register@master
with:
project: ${{ env.project }}
token: ${{ secrets.GITHUB_TOKEN }}
imageName: archifiltre/${{ env.project }}
##############################################################################
## GENERATE KUBERNETES MANIFESTS
##############################################################################
manifests:
name: Generate k8s manifests
runs-on: ubuntu-latest
steps:
- name: Use autodevops manifests generation
uses: SocialGouv/actions/autodevops-manifests@master
with:
environment: "dev"
##############################################################################
## DEPLOY APPLICATION OVER KUBERNETES
##############################################################################
deploy:
name: Deploy application
runs-on: ubuntu-latest
needs: [register, manifests]
steps:
- name: Use autodevops deployment
uses: SocialGouv/actions/autodevops-deploy@master
with:
environment: "dev"
token: ${{ secrets.GITHUB_TOKEN }}
kubeconfig: ${{ secrets.SOCIALGOUV_KUBE_CONFIG_DEV }}
include:
- project: SocialGouv/gitlab-ci-yml
file: /autodevops.yml
ref: v23.0.1
variables:
AUTO_DEVOPS_KANIKO: "🕹️"
AUTO_DEVOPS_RELEASE_AUTO: "🔖"
AUTO_DEVOPS_ENABLE_KAPP: "🕹️"
AUTO_DEVOPS_PRODUCTION_AUTO: "🚀"
PROJECT_PATH: SocialGouv/archifiltre-site
Install:
rules:
- when: never
Lint:
rules:
- when: never
Test:
rules:
- when: never
Build:
needs: []
cache:
key:
files:
- yarn.lock
prefix: ${CI_JOB_NAME}
paths:
- .cache
before_script:
- apk add automake autoconf libtool dpkg pkgconfig nasm libpng libpng-dev g++ make
script:
- yarn config set cache-folder $CI_PROJECT_DIR/.cache/yarn
- yarn --frozen-lockfile --prefer-offline
- rm -rf .cache
- yarn build
variables:
VERSION: ${CI_COMMIT_SHORT_SHA}
artifacts:
expire_in: 1 day
paths:
- public
......@@ -2,6 +2,8 @@
"type": "static",
"name": "archifiltre-site",
"subdomain": "archifiltre",
"project": "archifiltre",
"registry": "ghcr",
"ingress": {
"annotations": {}
}
......
## [1.64.9-alpha.2](https://github.com/SocialGouv/archifiltre-site/compare/v1.64.9-alpha.1...v1.64.9-alpha.2) (2021-09-01)
### Bug Fixes
* Add prod rancher ID. ([6607452](https://github.com/SocialGouv/archifiltre-site/commit/660745244d5a91f2820e4ea3caa7ade2eb65d5d1))
## [1.64.9-alpha.1](https://github.com/SocialGouv/archifiltre-site/compare/v1.64.8...v1.64.9-alpha.1) (2021-09-01)
### Bug Fixes
* Use autodevops actions. ([eeb8f26](https://github.com/SocialGouv/archifiltre-site/commit/eeb8f26baff7f675f72d587a612781c056b0af08))
## [1.64.8](https://github.com/SocialGouv/archifiltre-site/compare/v1.64.7...v1.64.8) (2021-08-04)
......
FROM ghcr.io/socialgouv/docker/nginx4spa:6.17.0
FROM node:14-alpine as builder
COPY ./public /usr/share/nginx/html
COPY . .
RUN apk add automake autoconf libtool dpkg pkgconfig nasm libpng libpng-dev g++ make
RUN yarn --frozen-lockfile --prefer-offline && yarn cache clean
RUN yarn build
FROM ghcr.io/socialgouv/docker/nginx4spa:6.24.0
COPY --from=builder ./public /usr/share/nginx/html
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment