Skip to content

milsman2 made a push. #156

milsman2 made a push.

milsman2 made a push. #156

name: GitHub Actions Demo
run-name: ${{ github.actor }} made a push.
on: [push]
jobs:
Explore-GitHub-Actions:
runs-on: ubuntu-latest
environment: build
steps:
- run: echo "🎉 The job was automatically triggered by a ${{ github.event_name }} event."
- run: echo "🐧 This job is now running on a ${{ runner.os }} server hosted by GitHub!"
- run: echo "The name of your branch is ${{ github.ref }} and your repository is ${{ github.repository }}."
- name: Check out repository code
uses: actions/checkout@v3
- run: echo "💡 The ${{ github.repository }} repository has been cloned to the runner."
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: '3.10'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r ./requirements.txt
- name: Analysing the code with pylint
run: |
pylint $(git ls-files '*.py')
- name: Run Python black
uses: psf/black@stable
with:
options: '--check --verbose'
src: './src'
- name: Run pytest
run: |
pytest ./tests
- name: Print sunrise/sunset data
run: |
python -m src.main
env:
TEST_URL: ${{ secrets.TEST_URL }}
- run: echo "🍏 This job's status is ${{ job.status }}."
DockerBuild:
runs-on: ubuntu-latest
environment: build
steps:
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Login to Docker Hub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Build and push
uses: docker/build-push-action@v5
with:
push: true
tags: milsman2/gh-actions-lab:latest
platforms: linux/amd64,linux/arm64