Skip to content

Commit

Permalink
Sem Ver
Browse files Browse the repository at this point in the history
  • Loading branch information
Nicconike committed Jun 8, 2024
1 parent 07d8942 commit 34e17dc
Show file tree
Hide file tree
Showing 3 changed files with 83 additions and 10 deletions.
59 changes: 54 additions & 5 deletions .github/workflows/docker-image.yml
Original file line number Diff line number Diff line change
@@ -1,14 +1,63 @@
name: Docker Image CI
name: CI/CD Pipeline

on:
workflow_dispatch:
pull_request:
branches: [ "master" ]
branches:
- master

jobs:
release:
runs-on: ubuntu-latest

steps:
- name: Checkout repository
uses: actions/checkout@v4

- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.x'

- name: Install dependencies
run: |
pip install setuptools wheel twine
pip install python-semantic-release
- name: Semantic Release
id: semantic_release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: semantic-release publish

- name: Extract version
id: extract_version
run: echo "VERSION=$(python -c 'import semantic_release; print(semantic_release.__version__)')" >> $GITHUB_ENV

build:
needs: release
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4
- name: Build the Docker image
run: docker build . --file Dockerfile --tag Steam-Stats:$(date +%s)
- name: Checkout repository
uses: actions/checkout@v4

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3

- name: Log in to Docker Hub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_TOKEN }}

- name: Build and push Docker image
uses: docker/build-push-action@v5
with:
context: .
push: true
tags: |
nicconike/steam-stats:${{ env.VERSION }}
- name: Remove dangling images
run: docker image prune -f
24 changes: 24 additions & 0 deletions .releaserc.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
{
branches:
[
{ name: "1.1.x", range: "1.1.x", channel: "1.1.x" },
{ name: "1.2.x", range: "1.2.x", channel: "1.2.x" },
{ name: "master" },
{ name: "pre/rc", channel: "pre/rc", prerelease: "rc" },
{ name: "beta", channel: "beta", prerelease: true },
],
plugins:
[
"@semantic-release/commit-analyzer",
"@semantic-release/release-notes-generator",
"@semantic-release/changelog",
[
"@semantic-release/git",
{
"assets": ["api/*.py"],
"message": "chore(release): ${nextRelease.version} [skip ci]\n\n${nextRelease.notes}",
},
],
"@semantic-release/github",
],
}
10 changes: 5 additions & 5 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -18,14 +18,14 @@ ADD requirements.txt /steam-stats/requirements.txt
RUN apt-get update && apt-get install -y --no-install-recommends \
git \
&& pip install --no-cache-dir -r /steam-stats/requirements.txt \
&& playwright install firefox\
&& pip install playwright \
&& playwright install-deps \
&& playwright install firefox \
&& git config --global user.email "action@github.com" \
&& git config --global user.name "GitHub Action" \
&& apt-get purge -y --auto-remove \
&& rm -rf /var/lib/apt/lists/*

# Configure git
RUN git config --global user.email "action@github.com" \
&& git config --global user.name "GitHub Action"

# Copy only the necessary application code into the container
ADD api/ /steam-stats/api/
ADD assets/ /steam-stats/assets/
Expand Down

1 comment on commit 34e17dc

@vercel
Copy link

@vercel vercel bot commented on 34e17dc Jun 8, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.