Switch to Gitea Actions #66

Closed
opened 2023-11-12 19:52:41 +00:00 by lukas · 2 comments
Owner

After setup-python works without hours of fiddling, we can use the following CI file.
For errors see https://git.kucharczyk.xyz/lukas/timetracker/actions/runs/7

name: Django CI/CD

on:
  push:
    branches: [ main ]
  pull_request:
    branches: [ main ]

jobs:
  test:
    runs-on: ubuntu-latest

    steps:
    - uses: actions/checkout@v2
    - name: Set up Python 3.10
      uses: actions/setup-python@v2
      with:
        python-version: 3.10
    - name: Install Poetry
      run: |
        python -m pip install poetry
        echo "$HOME/.local/bin" >> $GITHUB_PATH        
    - name: Install Dependencies
      run: |
        poetry install        
    - name: Apply migrations
      run: |
        poetry run python manage.py migrate        
    - name: Run Tests
      run: |
        poetry run python manage.py test        

  build-and-push:
    needs: test
    runs-on: ubuntu-latest
    steps:
    - name: Checkout
      uses: actions/checkout@v4
    - name: Set up Docker Buildx
      uses: docker/setup-buildx-action@v3
    - name: Build and push
      uses: docker/build-push-action@v5
      with:
        context: .
        push: true
        tags: |
          registry.kucharczyk.xyz/timetracker:latest
          registry.kucharczyk.xyz/timetracker:${{ env.VERSION_NUMBER }}          
    env:
      VERSION_NUMBER: 1.4.0


After `setup-python` works without hours of fiddling, we can use the following CI file. For errors see https://git.kucharczyk.xyz/lukas/timetracker/actions/runs/7 ```yaml name: Django CI/CD on: push: branches: [ main ] pull_request: branches: [ main ] jobs: test: runs-on: ubuntu-latest steps: - uses: actions/checkout@v2 - name: Set up Python 3.10 uses: actions/setup-python@v2 with: python-version: 3.10 - name: Install Poetry run: | python -m pip install poetry echo "$HOME/.local/bin" >> $GITHUB_PATH - name: Install Dependencies run: | poetry install - name: Apply migrations run: | poetry run python manage.py migrate - name: Run Tests run: | poetry run python manage.py test build-and-push: needs: test runs-on: ubuntu-latest steps: - name: Checkout uses: actions/checkout@v4 - name: Set up Docker Buildx uses: docker/setup-buildx-action@v3 - name: Build and push uses: docker/build-push-action@v5 with: context: . push: true tags: | registry.kucharczyk.xyz/timetracker:latest registry.kucharczyk.xyz/timetracker:${{ env.VERSION_NUMBER }} env: VERSION_NUMBER: 1.4.0 ```
Author
Owner

Temporarily testing out Actions without the test phase

Temporarily testing out Actions without the test phase
lukas added spent time 2023-11-17 20:25:35 +00:00
1 hour
Author
Owner

Fully finished and working, done in 4a1d08d4df

Fully finished and working, done in 4a1d08d4df
lukas closed this issue 2023-11-18 21:50:45 +00:00
Sign in to join this conversation.
No Label
No Milestone
No project
No Assignees
1 Participants
Notifications
Total Time Spent: 1 hour
lukas
1 hour
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: lukas/timetracker#66
No description provided.