From 4207c627b7af4bddf045da4e693400bfa418e617 Mon Sep 17 00:00:00 2001 From: Sergey Natalenko Date: Fri, 1 Mar 2024 20:33:13 +0300 Subject: [PATCH] Add release workflow --- .github/workflows/release.yml | 59 +++++++++++++++ .gitignore | 130 ++++++++++++++++++++++++++++++++++ docker-compose.yaml | 20 +++--- 3 files changed, 199 insertions(+), 10 deletions(-) create mode 100644 .github/workflows/release.yml diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 0000000..055881d --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,59 @@ +name: Make release + +on: + workflow_dispatch: + push: + branches: + - master + +jobs: + checking: + name: Check repository + uses: ./.github/workflows/check.yml + + build_and_push_docker: + name: Build and push AMD64 and ARM64 images + needs: checking + runs-on: ubuntu-latest + steps: + + - name: Set up tag + id: vars + run: echo "sha_short=`echo ${GITHUB_SHA} | cut -c1-8`" >> $GITHUB_OUTPUT + + - name: Checkout + uses: actions/checkout@v3 + + - name: Set up QEMU + uses: docker/setup-qemu-action@v2 + + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v2 + + - name: Login to Docker Hub + uses: docker/login-action@v2 + with: + username: ${{ secrets.DOCKERHUB_USERNAME }} + password: ${{ secrets.DOCKERHUB_TOKEN }} + + - name: Build and push backend image + uses: docker/build-push-action@v5 + with: + push: true + platforms: linux/amd64,linux/arm64 + context: ./ + file: ./docker/rest.dockerfile + tags: | + andytakker/industry-game-rest:latest + andytakker/vk-parser:${{ steps.vars.outputs.sha_short }} + + - name: Build and push frontend image + uses: docker/build-push-action@v5 + with: + push: true + platforms: linux/amd64,linux/arm64 + context: ./ + file: ./docker/frontend.dockerfile + tags: | + andytakker/industry-game-frontend:latest + andytakker/vk-parser:${{ steps.vars.outputs.sha_short }} \ No newline at end of file diff --git a/.gitignore b/.gitignore index 7b0c7e0..8826363 100644 --- a/.gitignore +++ b/.gitignore @@ -161,3 +161,133 @@ cython_debug/ .DS_Store ssl_keys/ *.pem +# Logs +logs +*.log +npm-debug.log* +yarn-debug.log* +yarn-error.log* +lerna-debug.log* +.pnpm-debug.log* + +# Diagnostic reports (https://nodejs.org/api/report.html) +report.[0-9]*.[0-9]*.[0-9]*.[0-9]*.json + +# Runtime data +pids +*.pid +*.seed +*.pid.lock + +# Directory for instrumented libs generated by jscoverage/JSCover +lib-cov + +# Coverage directory used by tools like istanbul +coverage +*.lcov + +# nyc test coverage +.nyc_output + +# Grunt intermediate storage (https://gruntjs.com/creating-plugins#storing-task-files) +.grunt + +# Bower dependency directory (https://bower.io/) +bower_components + +# node-waf configuration +.lock-wscript + +# Compiled binary addons (https://nodejs.org/api/addons.html) +build/Release + +# Dependency directories +node_modules/ +jspm_packages/ + +# Snowpack dependency directory (https://snowpack.dev/) +web_modules/ + +# TypeScript cache +*.tsbuildinfo + +# Optional npm cache directory +.npm + +# Optional eslint cache +.eslintcache + +# Optional stylelint cache +.stylelintcache + +# Microbundle cache +.rpt2_cache/ +.rts2_cache_cjs/ +.rts2_cache_es/ +.rts2_cache_umd/ + +# Optional REPL history +.node_repl_history + +# Output of 'npm pack' +*.tgz + +# Yarn Integrity file +.yarn-integrity + +# dotenv environment variable files +.env +.env.development.local +.env.test.local +.env.production.local +.env.local + +# parcel-bundler cache (https://parceljs.org/) +.cache +.parcel-cache + +# Next.js build output +.next +out + +# Nuxt.js build / generate output +.nuxt +dist + +# Gatsby files +.cache/ +# Comment in the public line in if your project uses Gatsby and not Next.js +# https://nextjs.org/blog/next-9-1#public-directory-support +# public + +# vuepress build output +.vuepress/dist + +# vuepress v2.x temp and cache directory +.temp +.cache + +# Docusaurus cache and generated files +.docusaurus + +# Serverless directories +.serverless/ + +# FuseBox cache +.fusebox/ + +# DynamoDB Local files +.dynamodb/ + +# TernJS port file +.tern-port + +# Stores VSCode versions used for testing VSCode extensions +.vscode-test + +# yarn v2 +.yarn/cache +.yarn/unplugged +.yarn/build-state.yml +.yarn/install-state.gz +.pnp.* diff --git a/docker-compose.yaml b/docker-compose.yaml index b533a8e..04bd060 100644 --- a/docker-compose.yaml +++ b/docker-compose.yaml @@ -12,10 +12,10 @@ services: rest: restart: on-failure - # image: andytakker/industry-game-rest:latest - build: - dockerfile: ./docker/rest.dockerfile - context: . + image: andytakker/industry-game-rest:latest + # build: + # dockerfile: ./docker/rest.dockerfile + # context: . entrypoint: python -m industry_game environment: APP_API_ADDRESS: 0.0.0.0 @@ -34,12 +34,12 @@ services: frontend: restart: on-failure - # image: andytakker/industry-game-frontend:latest - build: - dockerfile: ./docker/frontend.dockerfile - context: . - args: - BASE_URL: https://vk.com + image: andytakker/industry-game-frontend:latest + # build: + # dockerfile: ./docker/frontend.dockerfile + # context: . + # args: + # BASE_URL: https://vk.com ports: - 80:80 - 443:443