From b48cd782c88b8e077acb08916e59b365af73d589 Mon Sep 17 00:00:00 2001 From: Michele Fabbri Date: Wed, 13 Apr 2022 07:56:14 +0100 Subject: [PATCH] CI git push test --- .github/workflows/main.yml | 149 +++++++++++++++++++------------------ 1 file changed, 77 insertions(+), 72 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 942511a6a..cf90e9e49 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -13,39 +13,40 @@ on: jobs: run_jobs: runs-on: ubuntu-20.04 - services: - postgres: - image: postgres:13 - env: - POSTGRES_PASSWORD: postgres - POSTGRES_USER: postgres - options: >- - --health-cmd pg_isready - --health-interval 10s - --health-timeout 5s - --health-retries 5 - ports: - - 5432:5432 +# services: +# postgres: +# image: postgres:13 +# env: +# POSTGRES_PASSWORD: postgres +# POSTGRES_USER: postgres +# options: >- +# --health-cmd pg_isready +# --health-interval 10s +# --health-timeout 5s +# --health-retries 5 +# ports: +# - 5432:5432 steps: - - name: Build database - run: psql -c "CREATE DATABASE githubactions;" -U postgres -h localhost -p 5432 - env: - PGPASSWORD: postgres +# - name: Build database +# run: psql -c "CREATE DATABASE githubactions;" -U postgres -h localhost -p 5432 +# env: +# PGPASSWORD: postgres + - name: Set up Python uses: actions/setup-python@v2 with: python-version: '3.8' - name: Checkout branch - uses: actions/checkout@v2 + uses: actions/checkout@v3 - - name: Install Python dependecies - run: | - python -m pip install --upgrade pip - pip install -r requirements.txt - pip install coverage coveralls - env: - PIP_USE_MIRRORS: true +# - name: Install Python dependecies +# run: | +# python -m pip install --upgrade pip +# pip install -r requirements.txt +# pip install coverage coveralls +# env: +# PIP_USE_MIRRORS: true # - name: Run tests # run: | @@ -66,56 +67,60 @@ jobs: - name: Generate pip freeze requirements_frozen.txt run: | - pip freeze > requirements_frozen.txt - echo ">>> Contents of requirements_frozen.txt <<<" - cat requirements_frozen.txt + date > date_generated.txt +# pip freeze > requirements_frozen.txt +# echo ">>> Contents of requirements_frozen.txt <<<" +# cat requirements_frozen.txt - name: Setup git run: | - git config user.name "GitHub Actions" - git config user.email "<>" + git config user.name github-actions + git config user.email github-actions@github.com - name: Commit requirements_frozen.txt to repo run: | - git add requirements_frozen.txt + echo >>> git status <<< + git status + git add date_generated.txt +# git add requirements_frozen.txt git commit -m "GitHub Actions generated requirements_frozen.txt" git push - - name: Copy files to S3 - shell: bash - env: - aws_key_id: ${{ secrets.AWS_ACCESS_KEY_ID }} - aws_secret_access_key: ${{ secrets.AWS_SECRET_KEY_ID }} - aws_s3_bucket: ${{ secrets.AWS_S3BUCKET_NAME }} - aws_region: ${{ secrets.AWS_REGION }} - run: | - sudo apt-get update && sudo apt-get -y install awscli - aws configure set aws_access_key_id $aws_key_id - aws configure set aws_secret_access_key $aws_secret_access_key - aws configure set default.region $aws_region - aws s3 cp requirements_frozen.txt s3://$aws_s3_bucket/github_actions/ - aws s3 cp scripts/deployment_examples/alyx-docker/000-default-conf-alyx-dev s3://$aws_s3_bucket/github_actions/ - aws s3 cp scripts/deployment_examples/alyx-docker/000-default-conf-alyx-prod s3://$aws_s3_bucket/github_actions/ - aws s3 cp scripts/deployment_examples/alyx-docker/000-default-conf-openalyx s3://$aws_s3_bucket/github_actions/ - aws s3 cp scripts/deployment_examples/alyx-docker/apache-conf-alyx-dev s3://$aws_s3_bucket/github_actions/ - aws s3 cp scripts/deployment_examples/alyx-docker/apache-conf-alyx-prod s3://$aws_s3_bucket/github_actions/ - aws s3 cp scripts/deployment_examples/alyx-docker/apache-conf-openalyx s3://$aws_s3_bucket/github_actions/ - aws s3 cp scripts/deployment_examples/alyx-docker/cloudwatch_config.json-alyx-dev s3://$aws_s3_bucket/github_actions/ - aws s3 cp scripts/deployment_examples/alyx-docker/cloudwatch_config.json-alyx-prod s3://$aws_s3_bucket/github_actions/ - aws s3 cp scripts/deployment_examples/alyx-docker/cloudwatch_config.json-openalyx s3://$aws_s3_bucket/github_actions/ - aws s3 cp scripts/deployment_examples/alyx-docker/Dockerfile.ibl s3://$aws_s3_bucket/github_actions/ - - - name: Configure Docker login - if: ${{ github.ref == 'refs/heads/docker' }} - uses: docker/login-action@v1 - with: - username: ${{ secrets.DOCKER_HUB_USERNAME }} - password: ${{ secrets.DOCKER_HUB_ACCESS_TOKEN }} - - name: Set up Docker Buildx - if: ${{ github.ref == 'refs/heads/docker' }} - uses: docker/setup-buildx-action@v1 - - name: Build and push Docker base image - if: ${{ github.ref == 'refs/heads/docker' }} - uses: docker/build-push-action@v2 - with: - context: . - file: ./scripts/deployment_examples/alyx-docker/Dockerfile.base - push: true - tags: ${{ secrets.DOCKER_HUB_USERNAME }}/alyx:base \ No newline at end of file +# - name: Copy files to S3 +# shell: bash +# env: +# aws_key_id: ${{ secrets.AWS_ACCESS_KEY_ID }} +# aws_secret_access_key: ${{ secrets.AWS_SECRET_KEY_ID }} +# aws_s3_bucket: ${{ secrets.AWS_S3BUCKET_NAME }} +# aws_region: ${{ secrets.AWS_REGION }} +# run: | +# sudo apt-get update && sudo apt-get -y install awscli +# aws configure set aws_access_key_id $aws_key_id +# aws configure set aws_secret_access_key $aws_secret_access_key +# aws configure set default.region $aws_region +# aws s3 cp requirements_frozen.txt s3://$aws_s3_bucket/github_actions/ +# aws s3 cp scripts/deployment_examples/alyx-docker/000-default-conf-alyx-dev s3://$aws_s3_bucket/github_actions/ +# aws s3 cp scripts/deployment_examples/alyx-docker/000-default-conf-alyx-prod s3://$aws_s3_bucket/github_actions/ +# aws s3 cp scripts/deployment_examples/alyx-docker/000-default-conf-openalyx s3://$aws_s3_bucket/github_actions/ +# aws s3 cp scripts/deployment_examples/alyx-docker/apache-conf-alyx-dev s3://$aws_s3_bucket/github_actions/ +# aws s3 cp scripts/deployment_examples/alyx-docker/apache-conf-alyx-prod s3://$aws_s3_bucket/github_actions/ +# aws s3 cp scripts/deployment_examples/alyx-docker/apache-conf-openalyx s3://$aws_s3_bucket/github_actions/ +# aws s3 cp scripts/deployment_examples/alyx-docker/cloudwatch_config.json-alyx-dev s3://$aws_s3_bucket/github_actions/ +# aws s3 cp scripts/deployment_examples/alyx-docker/cloudwatch_config.json-alyx-prod s3://$aws_s3_bucket/github_actions/ +# aws s3 cp scripts/deployment_examples/alyx-docker/cloudwatch_config.json-openalyx s3://$aws_s3_bucket/github_actions/ +# aws s3 cp scripts/deployment_examples/alyx-docker/Dockerfile.ibl s3://$aws_s3_bucket/github_actions/ +# +# - name: Configure Docker login +# if: ${{ github.ref == 'refs/heads/docker' }} +# uses: docker/login-action@v1 +# with: +# username: ${{ secrets.DOCKER_HUB_USERNAME }} +# password: ${{ secrets.DOCKER_HUB_ACCESS_TOKEN }} +# - name: Set up Docker Buildx +# if: ${{ github.ref == 'refs/heads/docker' }} +# uses: docker/setup-buildx-action@v1 +# - name: Build and push Docker base image +# if: ${{ github.ref == 'refs/heads/docker' }} +# uses: docker/build-push-action@v2 +# with: +# context: . +# file: ./scripts/deployment_examples/alyx-docker/Dockerfile.base +# push: true +# tags: ${{ secrets.DOCKER_HUB_USERNAME }}/alyx:base \ No newline at end of file