toy/.gitea/workflows/demo.yaml

73 lines
1.5 KiB
YAML
Raw Normal View History

2024-07-02 20:29:59 +00:00
---
name: Gitea Actions Demo
run-name: ${{ gitea.actor }} is testing out Gitea Actions 🚀
on: [push]
jobs:
2024-07-07 21:17:23 +00:00
lint:
runs-on: ubuntu-latest
permissions:
checks: write
contents: write
steps:
2024-07-07 21:31:19 +00:00
- name: Checkout
uses: actions/checkout@v4
- name: Ruby Setup
uses: ruby/setup-ruby@v1
with:
ruby-version: '3.3'
bundler-cache: true
- run: bundle install
2024-07-07 21:17:23 +00:00
- name: Standard Ruby
2024-07-07 21:31:19 +00:00
run: bundle exec standardrb
2024-07-07 21:17:23 +00:00
2024-07-06 21:06:53 +00:00
test:
2024-07-07 21:31:19 +00:00
needs: lint
2024-07-06 21:06:53 +00:00
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Test
uses: ruby/setup-ruby@v1
with:
ruby-version: '3.3'
bundler-cache: true
2024-07-08 01:14:02 +00:00
- run: bundle exec rspec
2024-07-06 21:06:53 +00:00
2024-07-02 20:29:59 +00:00
release-image:
2024-07-06 21:06:53 +00:00
needs: test
2024-07-02 20:29:59 +00:00
runs-on: ubuntu-latest
container:
image: catthehacker/ubuntu:act-latest
env:
DOCKER_ORG: ryanc
DOCKER_LATEST: latest
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0 # all history for all branches and tags
2024-07-02 20:58:41 +00:00
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
2024-07-02 20:29:59 +00:00
- name: Login to Gitea registry
uses: docker/login-action@v3
with:
registry: git.kill0.net
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
2024-07-02 20:29:59 +00:00
- name: Docker build and push
uses: docker/build-push-action@v5
with:
push: true
2024-07-02 21:08:43 +00:00
tags: git.kill0.net/ryanc/toy:latest