diff --git a/.github/workflows/hugo_ci.yaml b/.github/workflows/hugo_ci.yaml new file mode 100644 index 00000000..dfede486 --- /dev/null +++ b/.github/workflows/hugo_ci.yaml @@ -0,0 +1,39 @@ +name: Hugo Build and Deploy + +on: push + +env: + BASE_URL: ${{ (github.ref == 'refs/heads/master' && 'gen3.org') || 'alpha.gen3.org' }} + +jobs: + build-and-deploy: + runs-on: ubuntu-latest + + steps: + - name: Checkout Code + uses: actions/checkout@v3 + + - name: Setup Hugo + uses: peaceiris/actions-hugo@v2 + with: + hugo-version: '0.100.2' + extended: true + + - name: Setup Asciidoctor + run: sudo apt-get install -y asciidoctor # support asciidoc files + + - name: Update Config (replace {BASE_URL}) + run: sed -i "s|{BASE_URL}|${BASE_URL}|g" config.yaml + + - name: Build Site + run: hugo + + - name: Install AWS CLI + uses: chrislennon/action-aws-cli@1.1 + + - name: Deploy to S3 + run: | + aws s3 cp public s3://${{ env.BASE_URL }}/ --recursive --region ${{ vars.AWS_REGION }} --acl public-read + env: + AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }} + AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }} diff --git a/.gitignore b/.gitignore index f09539ac..b5017121 100755 --- a/.gitignore +++ b/.gitignore @@ -2,3 +2,4 @@ themes_used *.DS_Store ./resources/ */_gen/ +.idea \ No newline at end of file diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index b6100a20..00000000 --- a/.travis.yml +++ /dev/null @@ -1,27 +0,0 @@ -language: node_js -sudo: required -env: - global: - - BASE_URL=$(if [ "$TRAVIS_BRANCH" == "master" ]; then echo "gen3.org"; else echo - "alpha.gen3.org"; fi) - - AWS_BUCKET=$BASE_URL -before_script: -- wget https://github.com/gohugoio/hugo/releases/download/v0.100.2/hugo_extended_0.100.2_Linux-64bit.deb -- sudo dpkg -i hugo*.deb -- sudo apt-get -y install asciidoctor -- echo $AWS_BUCKET -script: -- sed -i "s|{BASE_URL}|${BASE_URL}|g" config.yaml -- hugo -deploy: - provider: s3 - access_key_id: AKIAZRNPHKJIKXZU4Q5C - secret_access_key: - secure: fiQ9L7/Wuu6IiNRXfDfmfmHnKK/C3jiCelfzxEb+X+L62JxLDpQnQDnCPm0w6AHsq0EPD+QI7YeliH5isJP9ScMbeUlbHda/U8BfNcjHyrOF2vfrRO14DtDjmep5eUAI97iq1qMkRTyko1ksXLckyMQCFj5xGQrfPqExpQO/ndklxUC6WKurrzwopSKnAsiHJuZprKo9yeV76ylcujYS6dgsCoYWKtsu5I8BQXSRRCulp8GeEknyb0q3XgrKl5ETqiGe9iE11Vyk8pBa2uOAVfzsWGpcAns7S7+wdNXShCDuNPGj96CJiKZAJUeyEeg26hVRtv/mI/yAbFB4PXf4Uk+2/JuO2dgHdud5vbHM092K0wXdEPoeTKpzVrWxkScQczGhLywL9hsOOCt0XmGudApRvCDTZkyCMy5kaCZCwsr5aPzWvFJvTeTejjHXQ5F+86ZIkLVpGJn3jS6J1elqHApt8z6s2zLi9Rq19wDUjKuzke43q2pOFg76rNMMJw5GgMf4gI2qX1b4KHU2bB2595XbmB2b4kSRKCJtdq9pgZQzdEJLEpJ2Sz1tV3uohxl1hzZRkFjcYfSL7PR5fjA2yLtL76x3qrGlBKhVw08ZDKR3V5lr16qVlb9G7SepeNeedo5z6abkYRFqs3ev7dVZY0SjrU9VlUpPA/pgkSQkMT4= - bucket: "$AWS_BUCKET" - local_dir: public - skip_cleanup: true - acl: public_read - on: - repo: uc-cdis/gen3.org - all_branches: true