Swap out gitlab-ci for gitrea actions
This commit is contained in:
parent
4d76a95dae
commit
5ee5db597c
40
.gitea/workflows/container-deploy.yaml
Normal file
40
.gitea/workflows/container-deploy.yaml
Normal file
@ -0,0 +1,40 @@
|
|||||||
|
name: Test and Build Docker Image
|
||||||
|
run-name: 🐋
|
||||||
|
on: [push]
|
||||||
|
jobs:
|
||||||
|
Test-Build:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
permissions:
|
||||||
|
contents: read
|
||||||
|
packages: write
|
||||||
|
steps:
|
||||||
|
- run: python --version
|
||||||
|
- run: pip --version
|
||||||
|
- run: pip install -r
|
||||||
|
- name: Check out repository code
|
||||||
|
uses: actions/checkout@v3
|
||||||
|
- run: echo "💡 The ${{ gitea.repository }} repository has been cloned to the runner."
|
||||||
|
- name: List files in the repository
|
||||||
|
run: |
|
||||||
|
ls ${{ gitea.workspace }}
|
||||||
|
|
||||||
|
Build-Image:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- name: Checkout
|
||||||
|
uses: actions/checkout@v3
|
||||||
|
- name: Set up QEMU
|
||||||
|
uses: docker/setup-qemu-action@v2
|
||||||
|
- name: Set up Docker Buildx
|
||||||
|
uses: docker/setup-buildx-action@v2
|
||||||
|
- name: Log in to the Container registry
|
||||||
|
uses: docker/login-action@v2
|
||||||
|
with:
|
||||||
|
registry: git.oki.cx
|
||||||
|
username: ${{ github.repository_owner }}
|
||||||
|
password: ${{ secrets.GITEA_TOKEN }}
|
||||||
|
- name: Build and push
|
||||||
|
uses: docker/build-push-action@v4
|
||||||
|
with:
|
||||||
|
push: true
|
||||||
|
tags: user/app:latest
|
@ -1,16 +0,0 @@
|
|||||||
build-test:
|
|
||||||
image: python:3.9
|
|
||||||
script:
|
|
||||||
- python --version
|
|
||||||
- pip --version
|
|
||||||
- pip install -r requirements.txt
|
|
||||||
- echo "pytest needs finishing"
|
|
||||||
|
|
||||||
build-docker:
|
|
||||||
image: docker
|
|
||||||
services:
|
|
||||||
- docker:dind
|
|
||||||
script:
|
|
||||||
- echo $CI_REGISTRY_PASSWORD | docker login -u $CI_REGISTRY_USER $CI_REGISTRY --password-stdin
|
|
||||||
- docker build -t $CI_REGISTRY_IMAGE .
|
|
||||||
- docker push $CI_REGISTRY_IMAGE
|
|
Loading…
x
Reference in New Issue
Block a user