workflow: switch from gitea to jenkins
This commit is contained in:
@@ -1,39 +0,0 @@
|
||||
name: Docker Build & Push
|
||||
|
||||
on:
|
||||
push:
|
||||
branches: [ main ]
|
||||
workflow_dispatch: {}
|
||||
|
||||
|
||||
jobs:
|
||||
build-docker:
|
||||
runs-on: ubuntu-latest
|
||||
env:
|
||||
HOME: ${{ gitea.workspace }}/.home
|
||||
steps:
|
||||
- name: Prepare HOME
|
||||
run: mkdir -p "$HOME"
|
||||
- name: Checkout repository
|
||||
uses: actions/checkout@v3
|
||||
- name: Install nix
|
||||
uses: cachix/install-nix-action@v31
|
||||
- name: Setup cachix cache for devenv
|
||||
uses: cachix/cachix-action@v16
|
||||
with:
|
||||
name: devenv
|
||||
- name: Install devenv.sh
|
||||
run: nix profile install nixpkgs#devenv
|
||||
- name: Build the devenv shell and run any pre-commit hooks
|
||||
run: devenv test
|
||||
|
||||
- name: Log in to Docker registry
|
||||
shell: devenv shell bash -- -e {0}
|
||||
run: |
|
||||
docker login --username "${{ secrets.DOCKER_USERNAME }}" --password "${{ secrets.DOCKER_PASSWORD }}" "${{ secrets.DOCKER_REGISTRY }}"
|
||||
|
||||
- name: Build and push Docker image
|
||||
shell: devenv shell bash -- -e {0}
|
||||
run: |
|
||||
docker build -t ${{ secrets.DOCKER_REGISTRY }}/sheetless/sheetless-frontend:${{ gitea.ref_name }} .
|
||||
docker push ${{ secrets.DOCKER_REGISTRY }}/sheetless/sheetless-frontend:${{ gitea.ref_name }}
|
||||
34
Jenkinsfile
vendored
Normal file
34
Jenkinsfile
vendored
Normal file
@@ -0,0 +1,34 @@
|
||||
pipeline {
|
||||
agent {
|
||||
node {
|
||||
label 'devenv'
|
||||
}
|
||||
}
|
||||
triggers {
|
||||
cron('H/10 * * * *')
|
||||
}
|
||||
stages {
|
||||
stage('Checkout') {
|
||||
steps {
|
||||
git branch: 'master', credentialsId: '3563e7c8-6a79-407c-9681-5d6e6291ba34', url: 'https://gitlab.julian-mutter.de/julian/sheetless'
|
||||
}
|
||||
}
|
||||
stage('Build Flutter') {
|
||||
steps {
|
||||
sh 'devenv shell flutter build web --release'
|
||||
}
|
||||
}
|
||||
stage('Build Docker') {
|
||||
steps {
|
||||
sh 'docker build -t harbor.julian-mutter.de/sheetless/sheetless-frontend .'
|
||||
}
|
||||
}
|
||||
stage('Deploy Docker') {
|
||||
steps {
|
||||
withDockerRegistry([credentialsId: 'harbor-login-julian', url: 'https://harbor.julian-mutter.de']) {
|
||||
sh 'docker push harbor.julian-mutter.de/sheetless/sheetless-frontend'
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user