Skip to content

Commit

Permalink
Merge pull request #14 from Artsdatabanken/deployment
Browse files Browse the repository at this point in the history
Deployment
  • Loading branch information
Myrdrahl authored Mar 14, 2023
2 parents 3a5e188 + dcfa0cf commit f0a11d5
Show file tree
Hide file tree
Showing 4 changed files with 53 additions and 1 deletion.
2 changes: 2 additions & 0 deletions .github/workflows/deploy.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
cp build/* destinationRepo/
rm destinationRepo/kommune.tif
50 changes: 50 additions & 0 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
name: publish jsons to Administrativ_grense/Territorialområde/Fastlands-Norge & tif to punkt-oppslag

on:
push:
branches: [ master ]

jobs:
build:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3
- name: Use Node.js
uses: actions/setup-node@v3
with:
node-version: '16.x'
- run: npm install
- run: npm update
- run: npm run download
- run: npm run transform
- name: Create release
uses: ncipollo/release-action@v1
with:
artifacts: "build/*"
tag: v_${{ github.run_number }}
- name: Checkout
uses: actions/checkout@v3
with:
repository: artsdatabanken/kommune-kart
path: './destinationRepo'
token: ${{secrets.PUSH_TOKEN}}
- name: Run deployment script
run: ./.github/workflows/deploy.sh
shell: bash
- name: Push to kommune-kart
run: |
cd destinationRepo
git config --global user.name "GitHub Actions Bot"
git config --global user.email "<>"
git config --global --list
git stage .
git commit -m "Updated from kommune-kart-lastejobb v_${{ github.run_number }}"
git branch --set-upstream-to master
git push https://$USERNAME:$REPO_KEY@github.com/Artsdatabanken/kommune-kart.git
env:
REPO_KEY: ${{secrets.PUSH_TOKEN}}
USERNAME: github-actions[bot]
- name: post to slack
run: ./.github/workflows/slack.sh ${{ secrets.POST_SLACK }}
shell: bash
1 change: 1 addition & 0 deletions .github/workflows/slack.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
curl -X POST -H 'Content-type: application/json' --data '{"text":"deploy kommune-kart-lastejobb"}' $1
1 change: 0 additions & 1 deletion stages/transform/20_punkt_oppslag.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ const { dops } = require("@artsdatabanken/lastejobb");
main();

function main() {
console.log("punkt oppslag");
let srcFolder = 'build';
var n = dops.start_gdal(dops.create_container_name('punktOppslag'), srcFolder);
let cmd = `gdal_rasterize -a autorkode -tr 100 100 /tmp/kommune_25833.geojson /tmp/kommune.tif`
Expand Down

0 comments on commit f0a11d5

Please sign in to comment.