Skip to content

Commit

Permalink
Merge pull request #1 from appuio/cicd
Browse files Browse the repository at this point in the history
Modernize deployment
  • Loading branch information
ccremer authored Apr 8, 2022
2 parents 437de79 + 96a3883 commit ef29c49
Show file tree
Hide file tree
Showing 7 changed files with 129 additions and 10 deletions.
30 changes: 30 additions & 0 deletions .github/changelog-configuration.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
{
"pr_template": "- ${{TITLE}} (#${{NUMBER}})",
"categories": [
{
"title": "## 🚀 Features",
"labels": ["enhancement"]
},
{
"title": "## 🛠️ Minor Changes",
"labels": ["change"]
},
{
"title": "## 🔎 Breaking Changes",
"labels": ["breaking"]
},
{
"title": "## 🐛 Fixes",
"labels": ["bug"]
},
{
"title": "## 📄 Documentation",
"labels": ["documentation"]
},
{
"title": "## 🔗 Dependency Updates",
"labels": ["dependency"]
}
],
"template": "${{CATEGORIZED_COUNT}} changes since ${{FROM_TAG}}\n\n${{CHANGELOG}}"
}
22 changes: 22 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
name: Test

on:
pull_request: {}

jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3

- name: Docker meta
id: meta
uses: docker/metadata-action@v3
with:
images: ghcr.io/${{ github.repository }}

- name: Build image
uses: docker/build-push-action@v2
with:
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
58 changes: 58 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
name: Release

on:
push:
tags:
- "*"

env:
REGISTRY_URL: ghcr.io

jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0

- name: Docker meta
id: meta
uses: docker/metadata-action@v3
with:
images: ${{ env.REGISTRY_URL }}/${{ github.repository }}

- name: Docker login
uses: docker/login-action@v1
with:
registry: ${{ env.REGISTRY_URL }}
username: ${{ github.repository_owner }}
password: ${{ github.token }}

- name: Build image
uses: docker/build-push-action@v2
with:
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}

- name: Build changelog from PRs with labels
id: build_changelog
uses: mikepenz/release-changelog-builder-action@v2
with:
configuration: ".github/changelog-configuration.json"
# PreReleases still get a changelog, but the next full release gets a diff since the last full release,
# combining possible changelogs of all previous PreReleases in between.
# PreReleases show a partial changelog since last PreRelease.
ignorePreReleases: "${{ !contains(github.ref, '-rc') }}"
env:
GITHUB_TOKEN: ${{ github.token }}

- name: Create Release
uses: ncipollo/release-action@v1
with:
body: ${{steps.build_changelog.outputs.changelog}}
prerelease: "${{ contains(github.ref, '-rc') }}"
# Ensure target branch for release is "master"
commit: master
token: ${{ github.token }}
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ lib-cov
*.out
*.pid
*.gz
.*
*.sqlite
pids
logs
Expand Down
15 changes: 8 additions & 7 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,16 +1,17 @@
FROM node:lts-alpine3.10
FROM docker.io/library/node:lts-alpine

WORKDIR /usr/src/app

ENV \
NODE_ENV=production \
PORT=3000 \
HOST=0.0.0.0

CMD [ "npm", "start" ]

COPY package*.json ./

RUN npm i --only=production

# Bundle app source
COPY . .

ENV NODE_ENV=production
ENV PORT=3000

EXPOSE 3000
CMD [ "npm", "start" ]
3 changes: 1 addition & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
{
"name": "netlify-cms-github-oauth-provider",
"version": "1.0.0",
"engines": {
"node": ">=7.x"
},
"description": "netlify oauth github client sending token in form as netlify service itself",
"repository": "https://github.com/vencax/netlify-cms-github-oauth-provider",
"repository": "https://github.com/appuio/netlify-cms-github-oauth-provider",
"main": "index.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1",
Expand Down
10 changes: 10 additions & 0 deletions renovate.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"extends": [
"config:base",
":gitSignOff",
":disableDependencyDashboard"
],
"labels": [
"dependency"
]
}

0 comments on commit ef29c49

Please sign in to comment.