Merge pull request #13 from lszeremeta/dependabot/github_actions/dock… #96
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Create pre-release | |
on: | |
push: | |
branches: | |
- "master" | |
jobs: | |
test: | |
name: jMeter tests | |
runs-on: ubuntu-latest | |
services: | |
megen: | |
image: php:8.0-apache | |
ports: | |
- 80:80 | |
volumes: | |
- ${{ github.workspace }}:/var/www/html/ | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Run JMeter Tests | |
uses: rbhadti94/[email protected] | |
with: | |
testFilePath: tests/all.jmx | |
outputReportsFolder: reports/ | |
- uses: actions/upload-artifact@v3 | |
with: | |
name: jmeter-test-results | |
path: reports/ | |
pre-release: | |
name: GitHub pre-release | |
runs-on: ubuntu-latest | |
needs: test | |
steps: | |
- name: Wait for concurrent jobs | |
uses: softprops/turnstyle@v1 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
- name: Create GitHub pre-release | |
uses: "marvinpinto/action-automatic-releases@latest" | |
with: | |
repo_token: "${{ secrets.GITHUB_TOKEN }}" | |
automatic_release_tag: "beta" | |
prerelease: true | |
title: "Development Build" | |
beta-deploy: | |
name: Beta deploy | |
runs-on: ubuntu-latest | |
needs: test | |
steps: | |
- name: Get latest code | |
uses: actions/checkout@v4 | |
- name: Wait for concurrent jobs | |
uses: softprops/turnstyle@v1 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
- name: Sync files | |
uses: SamKirkland/[email protected] | |
with: | |
server: ${{ secrets.FTP_SERVER }} | |
username: ${{ secrets.FTP_USERNAME_BETA }} | |
password: ${{ secrets.FTP_PASSWORD_BETA }} | |
protocol: ftps | |
exclude: | | |
**/.git* | |
**/.git*/** | |
**/.github/** | |
.dockerignore | |
logo/raw-svg | |
logo/raw-svg/* | |
logo/megen.png | |
Dockerfile | |
tests | |
tests/* | |
LICENSE | |
README.md | |
stack.yml | |
docker-hub: | |
name: Docker Hub | |
runs-on: ubuntu-latest | |
needs: test | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Wait for concurrent jobs | |
uses: softprops/turnstyle@v1 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
- name: Prepare | |
id: prep | |
run: | | |
DOCKER_IMAGE=lszeremeta/megen | |
VERSION=latest | |
TAGS="${DOCKER_IMAGE}:${VERSION}" | |
echo ::set-output name=tags::${TAGS} | |
- name: Set up Docker Buildx | |
id: buildx | |
uses: docker/setup-buildx-action@v3 | |
- name: Cache Docker layers | |
uses: actions/cache@v3 | |
with: | |
path: /tmp/.buildx-cache | |
key: ${{ runner.os }}-buildx-${{ github.sha }} | |
restore-keys: | | |
${{ runner.os }}-buildx- | |
- name: Login to DockerHub | |
if: github.event_name != 'pull_request' | |
uses: docker/login-action@v3 | |
with: | |
username: ${{ secrets.DOCKERHUB_USERNAME }} | |
password: ${{ secrets.DOCKERHUB_PASSWORD }} | |
- name: Build and push | |
id: docker_build | |
uses: docker/build-push-action@v5 | |
with: | |
builder: ${{ steps.buildx.outputs.name }} | |
file: Dockerfile | |
push: ${{ github.event_name != 'pull_request' }} | |
tags: ${{ steps.prep.outputs.tags }} | |
cache-from: type=local,src=/tmp/.buildx-cache | |
cache-to: type=local,dest=/tmp/.buildx-cache | |
- name: Update repo description | |
uses: peter-evans/dockerhub-description@v3 | |
with: | |
username: ${{ secrets.DOCKERHUB_USERNAME }} | |
password: ${{ secrets.DOCKERHUB_PASS }} | |
repository: lszeremeta/megen |